/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.glue.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A structure used to provide information used to update a trigger. This object updates the previous trigger definition * by overwriting it completely. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TriggerUpdate implements Serializable, Cloneable, StructuredPojo { /** ** Reserved for future use. *
*/ private String name; /** ** A description of this trigger. *
*/ private String description; /** *
* A cron
expression used to specify the schedule (see Time-Based Schedules for
* Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify:
* cron(15 12 * * ? *)
.
*
* The actions initiated by this trigger. *
*/ private java.util.List* The predicate of this trigger, which defines when it will fire. *
*/ private Predicate predicate; /** ** Batch condition that must be met (specified number of events received or batch time window expired) before * EventBridge event trigger fires. *
*/ private EventBatchingCondition eventBatchingCondition; /** ** Reserved for future use. *
* * @param name * Reserved for future use. */ public void setName(String name) { this.name = name; } /** ** Reserved for future use. *
* * @return Reserved for future use. */ public String getName() { return this.name; } /** ** Reserved for future use. *
* * @param name * Reserved for future use. * @return Returns a reference to this object so that method calls can be chained together. */ public TriggerUpdate withName(String name) { setName(name); return this; } /** ** A description of this trigger. *
* * @param description * A description of this trigger. */ public void setDescription(String description) { this.description = description; } /** ** A description of this trigger. *
* * @return A description of this trigger. */ public String getDescription() { return this.description; } /** ** A description of this trigger. *
* * @param description * A description of this trigger. * @return Returns a reference to this object so that method calls can be chained together. */ public TriggerUpdate withDescription(String description) { setDescription(description); return this; } /** *
* A cron
expression used to specify the schedule (see Time-Based Schedules for
* Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify:
* cron(15 12 * * ? *)
.
*
cron
expression used to specify the schedule (see Time-Based
* Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would
* specify: cron(15 12 * * ? *)
.
*/
public void setSchedule(String schedule) {
this.schedule = schedule;
}
/**
*
* A cron
expression used to specify the schedule (see Time-Based Schedules for
* Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify:
* cron(15 12 * * ? *)
.
*
cron
expression used to specify the schedule (see Time-Based
* Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would
* specify: cron(15 12 * * ? *)
.
*/
public String getSchedule() {
return this.schedule;
}
/**
*
* A cron
expression used to specify the schedule (see Time-Based Schedules for
* Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify:
* cron(15 12 * * ? *)
.
*
cron
expression used to specify the schedule (see Time-Based
* Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would
* specify: cron(15 12 * * ? *)
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TriggerUpdate withSchedule(String schedule) {
setSchedule(schedule);
return this;
}
/**
* * The actions initiated by this trigger. *
* * @return The actions initiated by this trigger. */ public java.util.List* The actions initiated by this trigger. *
* * @param actions * The actions initiated by this trigger. */ public void setActions(java.util.Collection* The actions initiated by this trigger. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setActions(java.util.Collection)} or {@link #withActions(java.util.Collection)} if you want to override * the existing values. *
* * @param actions * The actions initiated by this trigger. * @return Returns a reference to this object so that method calls can be chained together. */ public TriggerUpdate withActions(Action... actions) { if (this.actions == null) { setActions(new java.util.ArrayList* The actions initiated by this trigger. *
* * @param actions * The actions initiated by this trigger. * @return Returns a reference to this object so that method calls can be chained together. */ public TriggerUpdate withActions(java.util.Collection* The predicate of this trigger, which defines when it will fire. *
* * @param predicate * The predicate of this trigger, which defines when it will fire. */ public void setPredicate(Predicate predicate) { this.predicate = predicate; } /** ** The predicate of this trigger, which defines when it will fire. *
* * @return The predicate of this trigger, which defines when it will fire. */ public Predicate getPredicate() { return this.predicate; } /** ** The predicate of this trigger, which defines when it will fire. *
* * @param predicate * The predicate of this trigger, which defines when it will fire. * @return Returns a reference to this object so that method calls can be chained together. */ public TriggerUpdate withPredicate(Predicate predicate) { setPredicate(predicate); return this; } /** ** Batch condition that must be met (specified number of events received or batch time window expired) before * EventBridge event trigger fires. *
* * @param eventBatchingCondition * Batch condition that must be met (specified number of events received or batch time window expired) before * EventBridge event trigger fires. */ public void setEventBatchingCondition(EventBatchingCondition eventBatchingCondition) { this.eventBatchingCondition = eventBatchingCondition; } /** ** Batch condition that must be met (specified number of events received or batch time window expired) before * EventBridge event trigger fires. *
* * @return Batch condition that must be met (specified number of events received or batch time window expired) * before EventBridge event trigger fires. */ public EventBatchingCondition getEventBatchingCondition() { return this.eventBatchingCondition; } /** ** Batch condition that must be met (specified number of events received or batch time window expired) before * EventBridge event trigger fires. *
* * @param eventBatchingCondition * Batch condition that must be met (specified number of events received or batch time window expired) before * EventBridge event trigger fires. * @return Returns a reference to this object so that method calls can be chained together. */ public TriggerUpdate withEventBatchingCondition(EventBatchingCondition eventBatchingCondition) { setEventBatchingCondition(eventBatchingCondition); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getSchedule() != null) sb.append("Schedule: ").append(getSchedule()).append(","); if (getActions() != null) sb.append("Actions: ").append(getActions()).append(","); if (getPredicate() != null) sb.append("Predicate: ").append(getPredicate()).append(","); if (getEventBatchingCondition() != null) sb.append("EventBatchingCondition: ").append(getEventBatchingCondition()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TriggerUpdate == false) return false; TriggerUpdate other = (TriggerUpdate) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getSchedule() == null ^ this.getSchedule() == null) return false; if (other.getSchedule() != null && other.getSchedule().equals(this.getSchedule()) == false) return false; if (other.getActions() == null ^ this.getActions() == null) return false; if (other.getActions() != null && other.getActions().equals(this.getActions()) == false) return false; if (other.getPredicate() == null ^ this.getPredicate() == null) return false; if (other.getPredicate() != null && other.getPredicate().equals(this.getPredicate()) == false) return false; if (other.getEventBatchingCondition() == null ^ this.getEventBatchingCondition() == null) return false; if (other.getEventBatchingCondition() != null && other.getEventBatchingCondition().equals(this.getEventBatchingCondition()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getSchedule() == null) ? 0 : getSchedule().hashCode()); hashCode = prime * hashCode + ((getActions() == null) ? 0 : getActions().hashCode()); hashCode = prime * hashCode + ((getPredicate() == null) ? 0 : getPredicate().hashCode()); hashCode = prime * hashCode + ((getEventBatchingCondition() == null) ? 0 : getEventBatchingCondition().hashCode()); return hashCode; } @Override public TriggerUpdate clone() { try { return (TriggerUpdate) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.glue.model.transform.TriggerUpdateMarshaller.getInstance().marshall(this, protocolMarshaller); } }