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.openecomp.policy.controlloop.policy;
23 public class ControlLoop {
25 public static String VERSION = "2.0.0";
27 public String controlLoopName;
28 public final String version = VERSION;
29 public String trigger_policy = FinalResult.FINAL_OPENLOOP.toString();
30 public Integer timeout;
31 public Boolean abatement = false;
33 public ControlLoop() {
37 public ControlLoop(ControlLoop controlLoop) {
38 this.controlLoopName = controlLoop.controlLoopName;
39 this.trigger_policy = controlLoop.trigger_policy;
40 this.timeout = controlLoop.timeout;
41 this.abatement = controlLoop.abatement;
44 public String toString() {
45 return "ControlLoop [controlLoopName=" + controlLoopName + ", version=" + version
46 + ", trigger_policy=" + trigger_policy + ", timeout="
47 + timeout + ", abatement=" + abatement + "]";
50 public int hashCode() {
53 result = prime * result + ((controlLoopName == null) ? 0 : controlLoopName.hashCode());
54 result = prime * result + ((timeout == null) ? 0 : timeout.hashCode());
55 result = prime * result + ((trigger_policy == null) ? 0 : trigger_policy.hashCode());
56 result = prime * result + ((version == null) ? 0 : version.hashCode());
57 result = prime * result + ((abatement == null) ? 0 : abatement.hashCode());
61 public boolean equals(Object obj) {
66 if (getClass() != obj.getClass())
68 ControlLoop other = (ControlLoop) obj;
69 if (controlLoopName == null) {
70 if (other.controlLoopName != null)
72 } else if (!controlLoopName.equals(other.controlLoopName))
74 if (timeout == null) {
75 if (other.timeout != null)
77 } else if (!timeout.equals(other.timeout))
79 if (trigger_policy == null) {
80 if (other.trigger_policy != null)
82 } else if (!trigger_policy.equals(other.trigger_policy))
84 if (version == null) {
85 if (other.version != null)
87 } else if (!version.equals(other.version))
89 if (abatement == null) {
90 if (other.abatement != null)
92 } else if (!abatement.equals(other.abatement))