2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.apex.context.test.concepts;
23 import java.io.Serializable;
25 import java.util.SortedSet;
26 import java.util.TreeSet;
29 * The Class TestContextItem00B.
31 public class TestContextTreeSetItem implements Serializable {
32 private static final long serialVersionUID = 1254589722957250388L;
34 private static final int HASH_PRIME_1 = 31;
36 private SortedSet<String> setValue = new TreeSet<>();
41 public TestContextTreeSetItem() {}
46 * @param setArray the set array
48 public TestContextTreeSetItem(final String[] setArray) {}
53 * @param setValue the set value
55 public TestContextTreeSetItem(final SortedSet<String> setValue) {
56 this.setValue = setValue;
62 * @return the sets the value
64 public Set<String> getSetValue() {
65 if (setValue == null) {
66 setValue = new TreeSet<>();
74 * @param setValue the sets the value
76 public void setSetValue(final SortedSet<String> setValue) {
77 this.setValue = setValue;
83 * @see java.lang.Object#hashCode()
86 public int hashCode() {
87 final int prime = HASH_PRIME_1;
89 result = prime * result + ((setValue == null) ? 0 : setValue.hashCode());
96 * @see java.lang.Object#equals(java.lang.Object)
99 public boolean equals(final Object obj) {
106 if (getClass() != obj.getClass()) {
109 final TestContextTreeSetItem other = (TestContextTreeSetItem) obj;
110 if (setValue == null) {
111 if (other.setValue != null) {
114 } else if (!setValue.equals(other.setValue)) {
123 * @see java.lang.Object#toString()
126 public String toString() {
127 return "TestContextItem00B [setValue=" + setValue + "]";