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() {
42 // Default constructor
48 * @param mapValue the map value
50 public TestContextTreeMapItem(final Map<String, String> mapValue) {
51 this.mapValue = mapValue;
57 * @return the map value
59 public Map<String, String> getMapValue() {
60 if (mapValue == null) {
61 mapValue = new TreeMap<>();
69 * @param mapValue the map value
71 public void setMapValue(final Map<String, String> mapValue) {
72 this.mapValue = mapValue;
79 public int hashCode() {
80 final int prime = HASH_PRIME_1;
82 result = prime * result + ((mapValue == null) ? 0 : mapValue.hashCode());
90 public boolean equals(final Object obj) {
97 if (getClass() != obj.getClass()) {
100 final TestContextTreeMapItem other = (TestContextTreeMapItem) obj;
101 if (mapValue == null) {
102 if (other.mapValue != null) {
105 } else if (!mapValue.equals(other.mapValue)) {
115 public String toString() {
116 return "TestContextItem00C [mapValue=" + mapValue + "]";