2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.energidataservice.internal.api;
15 import java.util.Collection;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
21 * Filter for the DatahubPricelist dataset.
23 * @author Jacob Laursen - Initial contribution
26 public class DatahubTariffFilter {
28 private final Set<ChargeTypeCode> chargeTypeCodes;
29 private final Set<String> notes;
30 private final DateQueryParameter start;
31 private final DateQueryParameter end;
33 public DatahubTariffFilter(DatahubTariffFilter filter, DateQueryParameter start) {
34 this(filter, start, DateQueryParameter.EMPTY);
37 public DatahubTariffFilter(DatahubTariffFilter filter, DateQueryParameter start, DateQueryParameter end) {
38 this(filter.chargeTypeCodes, filter.notes, start, end);
41 public DatahubTariffFilter(Set<ChargeTypeCode> chargeTypeCodes, Set<String> notes) {
42 this(chargeTypeCodes, notes, DateQueryParameter.EMPTY);
45 public DatahubTariffFilter(Set<ChargeTypeCode> chargeTypeCodes, Set<String> notes, DateQueryParameter start) {
46 this(chargeTypeCodes, notes, start, DateQueryParameter.EMPTY);
49 public DatahubTariffFilter(Set<ChargeTypeCode> chargeTypeCodes, Set<String> notes, DateQueryParameter start,
50 DateQueryParameter end) {
51 this.chargeTypeCodes = chargeTypeCodes;
57 public Collection<String> getChargeTypeCodesAsStrings() {
58 return chargeTypeCodes.stream().map(c -> c.toString()).toList();
61 public Collection<String> getNotes() {
65 public DateQueryParameter getStart() {
69 public DateQueryParameter getEnd() {