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=========================================================
20 package org.openecomp.policy.controlloop.policy;
22 import java.io.Serializable;
24 public class Target implements Serializable {
29 private static final long serialVersionUID = 2180988443264988319L;
31 public String resourceID;
32 public TargetType type;
38 public Target(TargetType type) {
42 public Target(String resourceID) {
43 this.resourceID = resourceID;
46 public Target(TargetType type, String resourceID) {
48 this.resourceID = resourceID;
51 public Target(Target target) {
52 this.type = target.type;
53 this.resourceID = target.resourceID;
57 public String toString() {
58 return "Target [type=" + type + ", resourceID=" + resourceID + "]";
62 public int hashCode() {
65 result = prime * result + ((type == null) ? 0 : type.hashCode());
66 result = prime * result + ((resourceID == null) ? 0 : resourceID.hashCode());
70 public boolean equals(Object obj) {
75 if (getClass() != obj.getClass())
77 Target other = (Target) obj;
79 if (other.type != null)
81 } else if (!type.equals(other.type))
83 if (resourceID == null) {
84 if (other.resourceID != null)
86 } else if (!resourceID.equals(other.resourceID))