]> git.basschouten.com Git - openhab-addons.git/blob
268e035c70e97b7a64e60df2705bb6fe37b33e96
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.hdpowerview.internal.api.responses;
14
15 import java.util.List;
16 import java.util.StringJoiner;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.hdpowerview.internal.api.SurveyData;
21
22 import com.google.gson.annotations.SerializedName;
23
24 /**
25  * Survey data of a single Shade, as returned by an HD PowerView hub
26  *
27  * @author Jacob Laursen - Initial contribution
28  */
29 @NonNullByDefault
30 public class Survey {
31     @SerializedName("shade_id")
32     public int shadeId;
33     @Nullable
34     @SerializedName("survey")
35     public List<SurveyData> surveyData;
36
37     @Override
38     public String toString() {
39         List<SurveyData> surveyData = this.surveyData;
40         if (surveyData == null) {
41             return "{}";
42         }
43         StringJoiner joiner = new StringJoiner(", ");
44         surveyData.forEach(data -> joiner.add(data.toString()));
45         return joiner.toString();
46     }
47 }