2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2019 Nordix Foundation.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.controlloop.policy;
24 import java.io.Serializable;
26 public class Target implements Serializable {
28 private static final long serialVersionUID = 2180988443264988319L;
30 private String resourceId;
31 private TargetType type;
34 //Does Nothing Empty Constructor
37 public Target(TargetType type) {
41 public Target(String resourceId) {
42 this.resourceId = resourceId;
45 public Target(TargetType type, String resourceId) {
47 this.resourceId = resourceId;
50 public Target(Target target) {
51 this.type = target.type;
52 this.resourceId = target.resourceId;
55 public String getResourceID() {
59 public void setResourceID(String resourceId) {
60 this.resourceId = resourceId;
63 public TargetType getType() {
67 public void setType(TargetType type) {
72 public String toString() {
73 return "Target [type=" + type + ", resourceId=" + resourceId + "]";
77 public int hashCode() {
80 result = prime * result + ((type == null) ? 0 : type.hashCode());
81 result = prime * result + ((resourceId == null) ? 0 : resourceId.hashCode());
86 public boolean equals(Object obj) {
93 if (getClass() != obj.getClass()) {
96 Target other = (Target) obj;
98 if (other.type != null) {
101 } else if (!type.equals(other.type)) {
104 if (resourceId == null) {
105 if (other.resourceId != null) {
108 } else if (!resourceId.equals(other.resourceId)) {