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.fmiweather.internal.client;
15 import java.math.BigDecimal;
16 import java.util.Arrays;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
22 * Simple class for numeric holding data
24 * @author Sami Salonen - Initial contribution
31 * Array of timestamps, as epoch seconds
33 public final long[] timestampsEpochSecs;
36 * Array of values, some of which may be null when value is not present.
38 public final @Nullable BigDecimal[] values;
42 * @param timestampsEpochSecs
44 * @throws IllegalArgumentException if length of timestampsEpochSecs and values do not match
46 public Data(long[] timestampsEpochSecs, BigDecimal[] values) {
47 if (timestampsEpochSecs.length != values.length) {
48 throw new IllegalArgumentException("length of arguments do not match");
50 this.timestampsEpochSecs = timestampsEpochSecs;
55 public String toString() {
56 return new StringBuilder("ResponseDataValues(timestampsEpochSecs=").append(Arrays.toString(timestampsEpochSecs))
57 .append(", values=").append(Arrays.deepToString(values)).append(")").toString();