2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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.onap.sdc.tosca.datatypes.model;
23 public class Trigger {
25 private String description;
26 private String event_type;
27 private TimeInterval schedule;
28 private EventFilter target_filter;
29 private Condition condition;
30 private Object action;
33 public int hashCode() {
34 int result = getDescription() != null ? getDescription().hashCode() : 0;
35 result = 31 * result + getEvent_type().hashCode();
36 result = 31 * result + (getSchedule() != null ? getSchedule().hashCode() : 0);
37 result = 31 * result + (getTarget_filter() != null ? getTarget_filter().hashCode() : 0);
38 result = 31 * result + (getCondition() != null ? getCondition().hashCode() : 0);
39 result = 31 * result + getAction().hashCode();
44 public boolean equals(Object o) {
48 if (!(o instanceof Trigger)) {
52 Trigger trigger = (Trigger) o;
54 if (getDescription() != null ? !getDescription().equals(trigger.getDescription()) :
55 trigger.getDescription() != null) {
58 if (!getEvent_type().equals(trigger.getEvent_type())) {
61 if (getSchedule() != null ? !getSchedule().equals(trigger.getSchedule()) : trigger.getSchedule() != null) {
64 if (getTarget_filter() != null ? !getTarget_filter().equals(trigger.getTarget_filter()) :
65 trigger.getTarget_filter() != null) {
68 if (getCondition() != null ? !getCondition().equals(trigger.getCondition()) : trigger.getCondition() != null) {
71 return getAction().equals(trigger.getAction());
74 public String getDescription() {
78 public void setDescription(String description) {
79 this.description = description;
82 public String getEvent_type() {
86 public void setEvent_type(String eventType) {
87 this.event_type = eventType;
90 public TimeInterval getSchedule() {
94 public void setSchedule(TimeInterval schedule) {
95 this.schedule = schedule;
98 public EventFilter getTarget_filter() {
102 public void setTarget_filter(EventFilter targetFilter) {
103 this.target_filter = targetFilter;
106 public Condition getCondition() {
110 public void setCondition(Condition condition) {
111 this.condition = condition;
114 public Object getAction() {
119 public void setAction(Object action) {
120 this.action = action;