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.meteoalerte.internal.json;
15 import java.util.ArrayList;
16 import java.util.List;
17 import java.util.Optional;
18 import java.util.stream.Stream;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.eclipse.jdt.annotation.Nullable;
23 import com.google.gson.annotations.SerializedName;
26 * The {@link ApiResponse} is the Java class used to map the JSON
27 * response to the webservice request.
29 * @author Gaƫl L'hopital - Initial contribution
32 public class ApiResponse {
33 @SerializedName("nhits")
35 private @Nullable Parameters parameters;
36 private List<Record> records = new ArrayList<>();
38 public int getNHits() {
42 public Optional<Parameters> getParameters() {
43 return Optional.ofNullable(parameters);
46 public Stream<Record> getRecords() {
47 return records.stream();