2 * Copyright (c) 2010-2020 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.Optional;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
20 import com.google.gson.annotations.SerializedName;
23 * The {@link ApiResponse} is the Java class used to map the JSON
24 * response to the webservice request.
26 * @author Gaƫl L'hopital - Initial contribution
29 public class ApiResponse {
30 @SerializedName("nhits")
32 private @Nullable Parameters parameters;
33 private Record[] records = {};
35 public int getNHits() {
39 public Optional<Parameters> getParameters() {
40 Parameters parameters = this.parameters;
41 if (parameters != null) {
42 return Optional.of(parameters);
44 return Optional.empty();
47 public Record[] getRecords() {