2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.onap.policy.controlloop.policy.guard;
\r
23 import java.util.LinkedList;
\r
25 public class ControlLoopGuard {
\r
27 private Guard guard;
\r
29 private LinkedList<GuardPolicy> guards;
\r
31 public ControlLoopGuard() {
\r
32 //DO Nothing Empty Constructor
\r
35 public Guard getGuard() {
\r
39 public void setGuard(Guard guard) {
\r
43 public LinkedList<GuardPolicy> getGuards() {
\r
47 public void setGuards(LinkedList<GuardPolicy> guards) {
\r
48 this.guards = guards;
\r
51 public ControlLoopGuard(ControlLoopGuard cLGuard) {
\r
52 this.guard = new Guard();
\r
53 this.guards = new LinkedList<>(cLGuard.guards);
\r
57 public String toString() {
\r
58 return "Guard [guard=" + guard + ", GuardPolicies=" + guards + "]";
\r
62 public int hashCode() {
\r
63 final int prime = 31;
\r
65 result = prime * result + ((guard == null) ? 0 : guard.hashCode());
\r
66 result = prime * result + ((guards == null) ? 0 : guards.hashCode());
\r
71 public boolean equals(Object obj) {
\r
76 if (getClass() != obj.getClass())
\r
78 ControlLoopGuard other = (ControlLoopGuard) obj;
\r
79 if (guard == null) {
\r
80 if (other.guard != null)
\r
82 } else if (!guard.equals(other.guard))
\r
84 if (guards == null) {
\r
85 if (other.guards != null)
\r
87 } else if (!guards.equals(other.guards))
\r