658b112bdff5a60c457328b17e8154fbfef1dc9a
[ccsdk/features.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.data;
23
24 import com.google.common.base.MoreObjects;
25 import java.util.Objects;
26 import javax.annotation.processing.Generated;
27 import org.opendaylight.yangtools.yang.binding.Augmentable;
28 import org.opendaylight.yangtools.yang.binding.CodeHelpers;
29 import org.opendaylight.yangtools.yang.binding.DataObject;
30
31 /**
32  *
33  * <p>
34  * This class represents the following YANG schema fragment defined in module <b>data-provider</b>
35  *
36  * <pre>
37  * container userdata {
38  *   leaf id {
39  *     type string;
40  *   }
41  *   leaf value {
42  *     type string;
43  *   }
44  * }
45  * </pre>
46  *
47  * The schema path to identify an instance is <i>data-provider/userdata</i>
48  *
49  * <p>
50  * To create instances of this class use {@link UserdataBuilder}.
51  *
52  * @see UserdataBuilder
53  *
54  */
55 @Generated("mdsal-binding-generator")
56 public interface Userdata extends Augmentable<Userdata>, DataObject {
57
58     /**
59      * Default implementation of {@link Object#hashCode()} contract for this interface. Implementations of this
60      * interface are encouraged to defer to this method to get consistent hashing results across all implementations.
61      *
62      * @param obj Object for which to generate hashCode() result.
63      * @return Hash code value of data modeled by this interface.
64      * @throws NullPointerException if {@code obj} is null
65      */
66     static int bindingHashCode(final Userdata obj) {
67         final int prime = 31;
68         int result = 1;
69         result = prime * result + Objects.hashCode(obj.getId());
70         result = prime * result + Objects.hashCode(obj.getValue());
71         result = prime * result + obj.augmentations().hashCode();
72         return result;
73     }
74
75     /**
76      * Default implementation of {@link Object#equals(Object)} contract for this interface. Implementations of this
77      * interface are encouraged to defer to this method to get consistent equality results across all implementations.
78      *
79      * @param thisObj Object acting as the receiver of equals invocation
80      * @param obj Object acting as argument to equals invocation
81      * @return True if thisObj and obj are considered equal
82      * @throws NullPointerException if {@code thisObj} is null
83      */
84     static boolean bindingEquals(final Userdata thisObj, final Object obj) {
85         if (thisObj == obj) {
86             return true;
87         }
88         final Userdata other = CodeHelpers.checkCast(Userdata.class, obj);
89         if (other == null) {
90             return false;
91         }
92         if (!Objects.equals(thisObj.getId(), other.getId())) {
93             return false;
94         }
95         if (!Objects.equals(thisObj.getValue(), other.getValue())) {
96             return false;
97         }
98         return thisObj.augmentations().equals(other.augmentations());
99     }
100
101     /**
102      * Default implementation of {@link Object#toString()} contract for this interface. Implementations of this
103      * interface are encouraged to defer to this method to get consistent string representations across all
104      * implementations.
105      *
106      * @param obj Object for which to generate toString() result.
107      * @return {@link String} value of data modeled by this interface.
108      * @throws NullPointerException if {@code obj} is null
109      */
110     static String bindingToString(final Userdata obj) {
111         final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Userdata");
112         CodeHelpers.appendValue(helper, "id", obj.getId());
113         CodeHelpers.appendValue(helper, "value", obj.getValue());
114         CodeHelpers.appendValue(helper, "augmentation", obj.augmentations().values());
115         return helper.toString();
116     }
117
118     /**
119      * Return id, or {@code null} if it is not present.
120      *
121      * @return {@code java.lang.String} id, or {@code null} if it is not present.
122      *
123      */
124     String getId();
125
126     /**
127      * Return value, or {@code null} if it is not present.
128      *
129      * @return {@code java.lang.String} value, or {@code null} if it is not present.
130      *
131      */
132     String getValue();
133
134 }
135