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 private String resourceID;
32 private TargetType type;
35 //Does Nothing Empty Constructor
38 public String getResourceID() {
42 public void setResourceID(String resourceID) {
43 this.resourceID = resourceID;
46 public TargetType getType() {
50 public void setType(TargetType type) {
54 public Target(TargetType type) {
58 public Target(String resourceID) {
59 this.resourceID = resourceID;
62 public Target(TargetType type, String resourceID) {
64 this.resourceID = resourceID;
67 public Target(Target target) {
68 this.type = target.type;
69 this.resourceID = target.resourceID;
73 public String toString() {
74 return "Target [type=" + type + ", resourceID=" + resourceID + "]";
78 public int hashCode() {
81 result = prime * result + ((type == null) ? 0 : type.hashCode());
82 result = prime * result + ((resourceID == null) ? 0 : resourceID.hashCode());
86 public boolean equals(Object obj) {
91 if (getClass() != obj.getClass())
93 Target other = (Target) obj;
95 if (other.type != null)
97 } else if (!type.equals(other.type))
99 if (resourceID == null) {
100 if (other.resourceID != null)
102 } else if (!resourceID.equals(other.resourceID))