3 * ============LICENSE_START=======================================================
5 * ================================================================================
6 * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
7 * Modifications Copyright (C) 2019 Tech Mahindra
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.policy.controlloop.policy;
25 import java.io.Serializable;
27 public class Target implements Serializable {
29 private static final long serialVersionUID = 2180988443264988319L;
31 private String resourceId;
32 private TargetType type;
34 private String modelInvariantId;
35 private String modelVersionId;
36 private String modelName;
37 private String modelVersion;
38 private String modelCustomizationId;
41 //Does Nothing Empty Constructor
44 public Target(TargetType type) {
48 public Target(String resourceId) {
49 this.resourceId = resourceId;
52 public Target(TargetType type, String resourceId) {
54 this.resourceId = resourceId;
57 public Target(Target target) {
58 this.type = target.type;
59 this.resourceId = target.resourceId;
62 public String getModelInvariantId() {
63 return modelInvariantId;
66 public void setModelInvariantId(String modelInvariantId) {
67 this.modelInvariantId = modelInvariantId;
70 public String getModelVersionId() {
71 return modelVersionId;
74 public void setModelVersionId(String modelVersionId) {
75 this.modelVersionId = modelVersionId;
78 public String getModelName() {
82 public void setModelName(String modelName) {
83 this.modelName = modelName;
86 public String getModelVersion() {
90 public void setModelVersion(String modelVersion) {
91 this.modelVersion = modelVersion;
94 public String getModelCustomizationId() {
95 return modelCustomizationId;
98 public void setModelCustomizationId(String modelCustomizationId) {
99 this.modelCustomizationId = modelCustomizationId;
102 public String getResourceID() {
106 public void setResourceID(String resourceId) {
107 this.resourceId = resourceId;
110 public TargetType getType() {
114 public void setType(TargetType type) {
119 public String toString() {
120 return "Target [type=" + type + ", resourceId=" + resourceId + "]";
124 public int hashCode() {
125 final int prime = 31;
127 result = prime * result + ((type == null) ? 0 : type.hashCode());
128 result = prime * result + ((resourceId == null) ? 0 : resourceId.hashCode());
133 public boolean equals(Object obj) {
140 if (getClass() != obj.getClass()) {
143 Target other = (Target) obj;
145 if (other.type != null) {
148 } else if (!type.equals(other.type)) {
151 if (resourceId == null) {
152 if (other.resourceId != null) {
155 } else if (!resourceId.equals(other.resourceId)) {