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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.apex.context.test.concepts;
24 import java.io.Serializable;
26 import java.util.TreeMap;
29 * The Class TestContextItem00C.
31 public class TestContextTreeMapItem implements Serializable {
32 private static final long serialVersionUID = -7497746259264651884L;
34 private static final int HASH_PRIME_1 = 31;
36 private Map<String, String> mapValue = new TreeMap<>();
41 public TestContextTreeMapItem() {}
46 * @param mapValue the map value
48 public TestContextTreeMapItem(final Map<String, String> mapValue) {
49 this.mapValue = mapValue;
55 * @return the map value
57 public Map<String, String> getMapValue() {
58 if (mapValue == null) {
59 mapValue = new TreeMap<>();
67 * @param mapValue the map value
69 public void setMapValue(final Map<String, String> mapValue) {
70 this.mapValue = mapValue;
76 * @see java.lang.Object#hashCode()
79 public int hashCode() {
80 final int prime = HASH_PRIME_1;
82 result = prime * result + ((mapValue == null) ? 0 : mapValue.hashCode());
89 * @see java.lang.Object#equals(java.lang.Object)
92 public boolean equals(final Object obj) {
99 if (getClass() != obj.getClass()) {
102 final TestContextTreeMapItem other = (TestContextTreeMapItem) obj;
103 if (mapValue == null) {
104 if (other.mapValue != null) {
107 } else if (!mapValue.equals(other.mapValue)) {
116 * @see java.lang.Object#toString()
119 public String toString() {
120 return "TestContextItem00C [mapValue=" + mapValue + "]";