1 package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110;
2 import org.opendaylight.yangtools.yang.binding.Augmentation;
3 import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
4 import org.opendaylight.yangtools.yang.binding.DataObject;
5 import java.util.HashMap;
6 import org.opendaylight.yangtools.concepts.Builder;
7 import java.util.Objects;
8 import java.util.Collections;
12 * Class that builds {@link org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput} instances.
14 * @see org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput
17 public class ExecuteGraphOutputBuilder implements Builder<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput> {
19 private java.lang.String _ackFinalIndicator;
20 private java.lang.String _contextMemoryJson;
21 private java.lang.String _responseCode;
22 private java.lang.String _responseMessage;
24 Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>>, Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> augmentation = Collections.emptyMap();
26 public ExecuteGraphOutputBuilder() {
28 public ExecuteGraphOutputBuilder(org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields arg) {
29 this._responseCode = arg.getResponseCode();
30 this._ackFinalIndicator = arg.getAckFinalIndicator();
31 this._responseMessage = arg.getResponseMessage();
32 this._contextMemoryJson = arg.getContextMemoryJson();
35 public ExecuteGraphOutputBuilder(ExecuteGraphOutput base) {
36 this._ackFinalIndicator = base.getAckFinalIndicator();
37 this._contextMemoryJson = base.getContextMemoryJson();
38 this._responseCode = base.getResponseCode();
39 this._responseMessage = base.getResponseMessage();
40 if (base instanceof ExecuteGraphOutputImpl) {
41 ExecuteGraphOutputImpl impl = (ExecuteGraphOutputImpl) base;
42 if (!impl.augmentation.isEmpty()) {
43 this.augmentation = new HashMap<>(impl.augmentation);
45 } else if (base instanceof AugmentationHolder) {
46 @SuppressWarnings("unchecked")
47 AugmentationHolder<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>) base;
48 if (!casted.augmentations().isEmpty()) {
49 this.augmentation = new HashMap<>(casted.augmentations());
55 *Set fields from given grouping argument. Valid argument is instance of one of following types:
57 * <li>org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields</li>
60 * @param arg grouping object
61 * @throws IllegalArgumentException if given argument is none of valid types
63 public void fieldsFrom(DataObject arg) {
64 boolean isValidArg = false;
65 if (arg instanceof org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields) {
66 this._responseCode = ((org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields)arg).getResponseCode();
67 this._ackFinalIndicator = ((org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields)arg).getAckFinalIndicator();
68 this._responseMessage = ((org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields)arg).getResponseMessage();
69 this._contextMemoryJson = ((org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields)arg).getContextMemoryJson();
73 throw new IllegalArgumentException(
74 "expected one of: [org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ResponseFields] \n" +
80 public java.lang.String getAckFinalIndicator() {
81 return _ackFinalIndicator;
84 public java.lang.String getContextMemoryJson() {
85 return _contextMemoryJson;
88 public java.lang.String getResponseCode() {
92 public java.lang.String getResponseMessage() {
93 return _responseMessage;
96 @SuppressWarnings("unchecked")
97 public <E extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> E getAugmentation(java.lang.Class<E> augmentationType) {
98 if (augmentationType == null) {
99 throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
101 return (E) augmentation.get(augmentationType);
105 public ExecuteGraphOutputBuilder setAckFinalIndicator(final java.lang.String value) {
106 this._ackFinalIndicator = value;
111 public ExecuteGraphOutputBuilder setContextMemoryJson(final java.lang.String value) {
112 this._contextMemoryJson = value;
117 public ExecuteGraphOutputBuilder setResponseCode(final java.lang.String value) {
118 this._responseCode = value;
123 public ExecuteGraphOutputBuilder setResponseMessage(final java.lang.String value) {
124 this._responseMessage = value;
128 public ExecuteGraphOutputBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput> augmentation) {
129 if (augmentation == null) {
130 return removeAugmentation(augmentationType);
133 if (!(this.augmentation instanceof HashMap)) {
134 this.augmentation = new HashMap<>();
137 this.augmentation.put(augmentationType, augmentation);
141 public ExecuteGraphOutputBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> augmentationType) {
142 if (this.augmentation instanceof HashMap) {
143 this.augmentation.remove(augmentationType);
149 public ExecuteGraphOutput build() {
150 return new ExecuteGraphOutputImpl(this);
153 private static final class ExecuteGraphOutputImpl implements ExecuteGraphOutput {
156 public java.lang.Class<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput> getImplementedInterface() {
157 return org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput.class;
160 private final java.lang.String _ackFinalIndicator;
161 private final java.lang.String _contextMemoryJson;
162 private final java.lang.String _responseCode;
163 private final java.lang.String _responseMessage;
165 private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>>, Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> augmentation = Collections.emptyMap();
167 private ExecuteGraphOutputImpl(ExecuteGraphOutputBuilder base) {
168 this._ackFinalIndicator = base.getAckFinalIndicator();
169 this._contextMemoryJson = base.getContextMemoryJson();
170 this._responseCode = base.getResponseCode();
171 this._responseMessage = base.getResponseMessage();
172 switch (base.augmentation.size()) {
174 this.augmentation = Collections.emptyMap();
177 final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>>, Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> e = base.augmentation.entrySet().iterator().next();
178 this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>>, Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>>singletonMap(e.getKey(), e.getValue());
181 this.augmentation = new HashMap<>(base.augmentation);
186 public java.lang.String getAckFinalIndicator() {
187 return _ackFinalIndicator;
191 public java.lang.String getContextMemoryJson() {
192 return _contextMemoryJson;
196 public java.lang.String getResponseCode() {
197 return _responseCode;
201 public java.lang.String getResponseMessage() {
202 return _responseMessage;
205 @SuppressWarnings("unchecked")
207 public <E extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> E getAugmentation(java.lang.Class<E> augmentationType) {
208 if (augmentationType == null) {
209 throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
211 return (E) augmentation.get(augmentationType);
214 private int hash = 0;
215 private volatile boolean hashValid = false;
218 public int hashCode() {
223 final int prime = 31;
225 result = prime * result + Objects.hashCode(_ackFinalIndicator);
226 result = prime * result + Objects.hashCode(_contextMemoryJson);
227 result = prime * result + Objects.hashCode(_responseCode);
228 result = prime * result + Objects.hashCode(_responseMessage);
229 result = prime * result + Objects.hashCode(augmentation);
237 public boolean equals(java.lang.Object obj) {
241 if (!(obj instanceof DataObject)) {
244 if (!org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput.class.equals(((DataObject)obj).getImplementedInterface())) {
247 org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput other = (org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput)obj;
248 if (!Objects.equals(_ackFinalIndicator, other.getAckFinalIndicator())) {
251 if (!Objects.equals(_contextMemoryJson, other.getContextMemoryJson())) {
254 if (!Objects.equals(_responseCode, other.getResponseCode())) {
257 if (!Objects.equals(_responseMessage, other.getResponseMessage())) {
260 if (getClass() == obj.getClass()) {
261 // Simple case: we are comparing against self
262 ExecuteGraphOutputImpl otherImpl = (ExecuteGraphOutputImpl) obj;
263 if (!Objects.equals(augmentation, otherImpl.augmentation)) {
267 // Hard case: compare our augments with presence there...
268 for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>>, Augmentation<org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphOutput>> e : augmentation.entrySet()) {
269 if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
273 // .. and give the other one the chance to do the same
274 if (!obj.equals(this)) {
282 public java.lang.String toString() {
283 java.lang.String name = "ExecuteGraphOutput [";
284 java.lang.StringBuilder builder = new java.lang.StringBuilder (name);
285 if (_ackFinalIndicator != null) {
286 builder.append("_ackFinalIndicator=");
287 builder.append(_ackFinalIndicator);
288 builder.append(", ");
290 if (_contextMemoryJson != null) {
291 builder.append("_contextMemoryJson=");
292 builder.append(_contextMemoryJson);
293 builder.append(", ");
295 if (_responseCode != null) {
296 builder.append("_responseCode=");
297 builder.append(_responseCode);
298 builder.append(", ");
300 if (_responseMessage != null) {
301 builder.append("_responseMessage=");
302 builder.append(_responseMessage);
304 final int builderLength = builder.length();
305 final int builderAdditionalLength = builder.substring(name.length(), builderLength).length();
306 if (builderAdditionalLength > 2 && !builder.substring(builderLength - 2, builderLength).equals(", ")) {
307 builder.append(", ");
309 builder.append("augmentation=");
310 builder.append(augmentation.values());
311 return builder.append(']').toString();