2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.std;
25 public class Matches {
26 private String onapName = null;
28 private String configName = null;
30 private Map<String, String> configAttributes = null;
32 public String getOnapName() {
36 public void setOnapName(final String onapName) {
37 this.onapName = onapName;
40 public String getConfigName() {
44 public void setConfigName(final String configName) {
45 this.configName = configName;
48 public Map<String, String> getConfigAttributes() {
49 return configAttributes;
52 public void setConfigAttributes(final Map<String, String> configAttributes) {
53 this.configAttributes = configAttributes;
57 public int hashCode() {
60 result = prime * result + ((configAttributes == null) ? 0 : configAttributes.hashCode());
61 result = prime * result + ((configName == null) ? 0 : configName.hashCode());
62 result = prime * result + ((onapName == null) ? 0 : onapName.hashCode());
67 public boolean equals(final Object obj) {
68 if (obj instanceof Matches) {
69 final Matches other = (Matches) obj;
70 return isEqual(onapName, other.onapName) && isEqual(configName, other.configName)
71 && isEqual(configAttributes, other.configAttributes);
76 private boolean isEqual(final Object objectA, final Object objectB) {
77 if (objectA == null) {
78 return objectB == null;
80 return objectA.equals(objectB);