Replace non-Javadoc comments with inheritDocs
[policy/apex-pdp.git] / testsuites / integration / integration-common / src / main / java / org / onap / policy / apex / context / test / concepts / TestContextTreeSetItem.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  *  Modifications Copyright (C) 2019 Nordix Foundation.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.apex.context.test.concepts;
23
24 import java.io.Serializable;
25 import java.util.Arrays;
26 import java.util.Set;
27 import java.util.SortedSet;
28 import java.util.TreeSet;
29
30 /**
31  * The Class TestContextItem00B.
32  */
33 public class TestContextTreeSetItem implements Serializable {
34     private static final long serialVersionUID = 1254589722957250388L;
35
36     private static final int HASH_PRIME_1 = 31;
37
38     private SortedSet<String> setValue = new TreeSet<>();
39
40     /**
41      * The Constructor.
42      */
43     public TestContextTreeSetItem() {}
44
45     /**
46      * The Constructor.
47      *
48      * @param setArray the set array
49      */
50     public TestContextTreeSetItem(final String[] setArray) {
51         this.setValue = new TreeSet<>(Arrays.asList(setArray));
52     }
53
54     /**
55      * The Constructor.
56      *
57      * @param setValue the set value
58      */
59     public TestContextTreeSetItem(final SortedSet<String> setValue) {
60         this.setValue = setValue;
61     }
62
63     /**
64      * Gets the set value.
65      *
66      * @return the sets the value
67      */
68     public Set<String> getSetValue() {
69         if (setValue == null) {
70             setValue = new TreeSet<>();
71         }
72         return setValue;
73     }
74
75     /**
76      * Sets the set value.
77      *
78      * @param setValue the sets the value
79      */
80     public void setSetValue(final SortedSet<String> setValue) {
81         this.setValue = setValue;
82     }
83
84     /**
85      * {@inheritDoc}.
86      */
87     @Override
88     public int hashCode() {
89         final int prime = HASH_PRIME_1;
90         int result = 1;
91         result = prime * result + ((setValue == null) ? 0 : setValue.hashCode());
92         return result;
93     }
94
95     /**
96      * {@inheritDoc}.
97      */
98     @Override
99     public boolean equals(final Object obj) {
100         if (this == obj) {
101             return true;
102         }
103         if (obj == null) {
104             return false;
105         }
106         if (getClass() != obj.getClass()) {
107             return false;
108         }
109         final TestContextTreeSetItem other = (TestContextTreeSetItem) obj;
110         if (setValue == null) {
111             if (other.setValue != null) {
112                 return false;
113             }
114         } else if (!setValue.equals(other.setValue)) {
115             return false;
116         }
117         return true;
118     }
119
120     /**
121      * {@inheritDoc}.
122      */
123     @Override
124     public String toString() {
125         return "TestContextItem00B [setValue=" + setValue + "]";
126     }
127 }