1 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119;
2 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
3 import java.util.Collections;
5 import org.opendaylight.yangtools.yang.binding.DataObject;
6 import java.util.HashMap;
7 import org.opendaylight.yangtools.concepts.Builder;
8 import org.opendaylight.yangtools.yang.binding.Augmentation;
12 * Class that builds {@link org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput} instances.
14 * @see org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput
17 public class ClearToastsMadeInputBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput> {
19 private InstanceIdentifier<?> _contextInstance;
21 Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> augmentation = new HashMap<>();
23 public ClearToastsMadeInputBuilder() {
25 public ClearToastsMadeInputBuilder(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.RpcContextRef arg) {
26 this._contextInstance = arg.getContextInstance();
29 public ClearToastsMadeInputBuilder(ClearToastsMadeInput base) {
30 this._contextInstance = base.getContextInstance();
31 if (base instanceof ClearToastsMadeInputImpl) {
32 ClearToastsMadeInputImpl _impl = (ClearToastsMadeInputImpl) base;
33 this.augmentation = new HashMap<>(_impl.augmentation);
38 *Set fields from given grouping argument. Valid argument is instance of one of following types:
40 * <li>org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.RpcContextRef</li>
43 * @param arg grouping object
44 * @throws IllegalArgumentException if given argument is none of valid types
46 public void fieldsFrom(DataObject arg) {
47 boolean isValidArg = false;
48 if (arg instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.RpcContextRef) {
49 this._contextInstance = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.RpcContextRef)arg).getContextInstance();
53 throw new IllegalArgumentException(
54 "expected one of: [org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.rpc.context.rev130617.RpcContextRef] \n" +
60 public InstanceIdentifier<?> getContextInstance() {
61 return _contextInstance;
64 @SuppressWarnings("unchecked")
65 public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> E getAugmentation(java.lang.Class<E> augmentationType) {
66 if (augmentationType == null) {
67 throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
69 return (E) augmentation.get(augmentationType);
72 public ClearToastsMadeInputBuilder setContextInstance(InstanceIdentifier<?> value) {
73 this._contextInstance = value;
77 public ClearToastsMadeInputBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput> augmentation) {
78 if (augmentation == null) {
79 return removeAugmentation(augmentationType);
81 this.augmentation.put(augmentationType, augmentation);
85 public ClearToastsMadeInputBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> augmentationType) {
86 this.augmentation.remove(augmentationType);
90 public ClearToastsMadeInput build() {
91 return new ClearToastsMadeInputImpl(this);
94 private static final class ClearToastsMadeInputImpl implements ClearToastsMadeInput {
96 public java.lang.Class<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput> getImplementedInterface() {
97 return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput.class;
100 private final InstanceIdentifier<?> _contextInstance;
102 private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> augmentation = new HashMap<>();
104 private ClearToastsMadeInputImpl(ClearToastsMadeInputBuilder base) {
105 this._contextInstance = base.getContextInstance();
106 switch (base.augmentation.size()) {
108 this.augmentation = Collections.emptyMap();
111 final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> e = base.augmentation.entrySet().iterator().next();
112 this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>>singletonMap(e.getKey(), e.getValue());
115 this.augmentation = new HashMap<>(base.augmentation);
120 public InstanceIdentifier<?> getContextInstance() {
121 return _contextInstance;
124 @SuppressWarnings("unchecked")
126 public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> E getAugmentation(java.lang.Class<E> augmentationType) {
127 if (augmentationType == null) {
128 throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
130 return (E) augmentation.get(augmentationType);
134 public int hashCode() {
135 final int prime = 31;
137 result = prime * result + ((_contextInstance == null) ? 0 : _contextInstance.hashCode());
138 result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode());
143 public boolean equals(java.lang.Object obj) {
147 if (!(obj instanceof DataObject)) {
150 if (!org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput.class.equals(((DataObject)obj).getImplementedInterface())) {
153 org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput other = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput)obj;
154 if (_contextInstance == null) {
155 if (other.getContextInstance() != null) {
158 } else if(!_contextInstance.equals(other.getContextInstance())) {
161 if (getClass() == obj.getClass()) {
162 // Simple case: we are comparing against self
163 ClearToastsMadeInputImpl otherImpl = (ClearToastsMadeInputImpl) obj;
164 if (augmentation == null) {
165 if (otherImpl.augmentation != null) {
168 } else if(!augmentation.equals(otherImpl.augmentation)) {
172 // Hard case: compare our augments with presence there...
173 for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.alto.provider.impl.rev141119.ClearToastsMadeInput>> e : augmentation.entrySet()) {
174 if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
178 // .. and give the other one the chance to do the same
179 if (!obj.equals(this)) {
187 public java.lang.String toString() {
188 java.lang.StringBuilder builder = new java.lang.StringBuilder ("ClearToastsMadeInput [");
189 boolean first = true;
191 if (_contextInstance != null) {
195 builder.append(", ");
197 builder.append("_contextInstance=");
198 builder.append(_contextInstance);
203 builder.append(", ");
205 builder.append("augmentation=");
206 builder.append(augmentation.values());
207 return builder.append(']').toString();