11package org .openhab .binding .haywardomnilogiclocal .internal .config ;
22
3+ import java .util .ArrayList ;
4+ import java .util .List ;
5+
36import org .eclipse .jdt .annotation .NonNullByDefault ;
47import org .eclipse .jdt .annotation .Nullable ;
58
69import com .thoughtworks .xstream .annotations .XStreamAlias ;
710import com .thoughtworks .xstream .annotations .XStreamAsAttribute ;
11+ import com .thoughtworks .xstream .annotations .XStreamImplicit ;
12+ import com .thoughtworks .xstream .annotations .XStreamConverter ;
13+ import com .thoughtworks .xstream .converters .extended .ToAttributedValueConverter ;
814
915/**
1016 * Representation of a Filter element.
@@ -16,16 +22,160 @@ public class FilterConfig {
1622 @ XStreamAlias ("systemId" )
1723 private @ Nullable String systemId ;
1824
25+ @ XStreamAlias ("System-Id" )
26+ private @ Nullable String systemIdElement ;
27+
1928 @ XStreamAsAttribute
2029 @ XStreamAlias ("pumpId" )
2130 private @ Nullable String pumpId ;
2231
32+ @ XStreamAlias ("Pump-Id" )
33+ private @ Nullable String pumpIdElement ;
34+
35+ @ XStreamAsAttribute
36+ private @ Nullable String nameAttribute ;
37+
38+ @ XStreamAlias ("Name" )
39+ private @ Nullable String nameElement ;
40+
41+ @ XStreamAsAttribute
42+ @ XStreamAlias ("sharedType" )
43+ private @ Nullable String sharedTypeAttribute ;
44+
45+ @ XStreamAlias ("Shared-Type" )
46+ private @ Nullable String sharedTypeElement ;
47+
48+ @ XStreamAsAttribute
49+ @ XStreamAlias ("filterType" )
50+ private @ Nullable String filterTypeAttribute ;
51+
52+ @ XStreamAlias ("Filter-Type" )
53+ private @ Nullable String filterTypeElement ;
54+
55+ @ XStreamAlias ("Max-Pump-Speed" )
56+ private @ Nullable String maxPumpSpeed ;
57+
58+ @ XStreamAlias ("Min-Pump-Speed" )
59+ private @ Nullable String minPumpSpeed ;
60+
61+ @ XStreamAlias ("Max-Pump-RPM" )
62+ private @ Nullable String maxPumpRpm ;
63+
64+ @ XStreamAlias ("Min-Pump-RPM" )
65+ private @ Nullable String minPumpRpm ;
66+
67+ @ XStreamAlias ("Vsp-Low-Pump-Speed" )
68+ private @ Nullable String vspLowPumpSpeed ;
69+
70+ @ XStreamAlias ("Vsp-Medium-Pump-Speed" )
71+ private @ Nullable String vspMediumPumpSpeed ;
72+
73+ @ XStreamAlias ("Vsp-High-Pump-Speed" )
74+ private @ Nullable String vspHighPumpSpeed ;
75+
76+ @ XStreamAlias ("Vsp-Custom-Pump-Speed" )
77+ private @ Nullable String vspCustomPumpSpeed ;
78+
79+ @ XStreamImplicit (itemFieldName = "Operation" )
80+ private final List <OperationConfig > operations = new ArrayList <>();
81+
2382 public @ Nullable String getSystemId () {
24- return systemId ;
83+ return systemId != null ? systemId : systemIdElement ;
2584 }
2685
2786 public @ Nullable String getPumpId () {
28- return pumpId ;
87+ return pumpId != null ? pumpId : pumpIdElement ;
88+ }
89+
90+ public @ Nullable String getName () {
91+ return nameAttribute != null ? nameAttribute : nameElement ;
92+ }
93+
94+ public @ Nullable String getSharedType () {
95+ return sharedTypeAttribute != null ? sharedTypeAttribute : sharedTypeElement ;
96+ }
97+
98+ public @ Nullable String getFilterType () {
99+ return filterTypeAttribute != null ? filterTypeAttribute : filterTypeElement ;
100+ }
101+
102+ public @ Nullable String getMaxPumpSpeed () {
103+ return maxPumpSpeed ;
104+ }
105+
106+ public @ Nullable String getMinPumpSpeed () {
107+ return minPumpSpeed ;
108+ }
109+
110+ public @ Nullable String getMaxPumpRpm () {
111+ return maxPumpRpm ;
112+ }
113+
114+ public @ Nullable String getMinPumpRpm () {
115+ return minPumpRpm ;
116+ }
117+
118+ public @ Nullable String getVspLowPumpSpeed () {
119+ return vspLowPumpSpeed ;
120+ }
121+
122+ public @ Nullable String getVspMediumPumpSpeed () {
123+ return vspMediumPumpSpeed ;
124+ }
125+
126+ public @ Nullable String getVspHighPumpSpeed () {
127+ return vspHighPumpSpeed ;
128+ }
129+
130+ public @ Nullable String getVspCustomPumpSpeed () {
131+ return vspCustomPumpSpeed ;
132+ }
133+
134+ public List <OperationConfig > getOperations () {
135+ return operations ;
136+ }
137+
138+ @ NonNullByDefault
139+ @ XStreamAlias ("Operation" )
140+ @ XStreamConverter (value = ToAttributedValueConverter .class , strings = "type" )
141+ public static class OperationConfig {
142+ private @ Nullable String type ;
143+
144+ @ XStreamImplicit (itemFieldName = "Action" )
145+ private final List <ActionConfig > actions = new ArrayList <>();
146+
147+ public @ Nullable String getType () {
148+ return type ;
149+ }
150+
151+ public List <ActionConfig > getActions () {
152+ return actions ;
153+ }
154+ }
155+
156+ @ NonNullByDefault
157+ @ XStreamAlias ("Action" )
158+ @ XStreamConverter (value = ToAttributedValueConverter .class , strings = "type" )
159+ public static class ActionConfig {
160+ private @ Nullable String type ;
161+
162+ @ XStreamImplicit (itemFieldName = "Device" )
163+ private final List <DeviceConfig > devices = new ArrayList <>();
164+
165+ @ XStreamImplicit (itemFieldName = "Parameter" )
166+ private final List <ParameterConfig > parameters = new ArrayList <>();
167+
168+ public @ Nullable String getType () {
169+ return type ;
170+ }
171+
172+ public List <DeviceConfig > getDevices () {
173+ return devices ;
174+ }
175+
176+ public List <ParameterConfig > getParameters () {
177+ return parameters ;
178+ }
29179 }
30180}
31181
0 commit comments