2 * Copyright (c) 2010-2023 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 dateQueryParameter;
32 public DatahubTariffFilter(DatahubTariffFilter filter, DateQueryParameter dateQueryParameter) {
33 this(filter.chargeTypeCodes, filter.notes, dateQueryParameter);
36 public DatahubTariffFilter(Set<ChargeTypeCode> chargeTypeCodes, Set<String> notes) {
37 this(chargeTypeCodes, notes, DateQueryParameter.EMPTY);
40 public DatahubTariffFilter(Set<ChargeTypeCode> chargeTypeCodes, Set<String> notes,
41 DateQueryParameter dateQueryParameter) {
42 this.chargeTypeCodes = chargeTypeCodes;
44 this.dateQueryParameter = dateQueryParameter;
47 public Collection<String> getChargeTypeCodesAsStrings() {
48 return chargeTypeCodes.stream().map(c -> c.toString()).toList();
51 public Collection<String> getNotes() {
55 public DateQueryParameter getDateQueryParameter() {
56 return dateQueryParameter;