/* * 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; /** *

* Defines a condition under which a trigger fires. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Condition implements Serializable, Cloneable, StructuredPojo { /** *

* A logical operator. *

*/ private String logicalOperator; /** *

* The name of the job whose JobRuns this condition applies to, and on which this trigger waits. *

*/ private String jobName; /** *

* The condition state. Currently, the only job states that a trigger can listen for are SUCCEEDED, * STOPPED, FAILED, and TIMEOUT. The only crawler states that a trigger can * listen for are SUCCEEDED, FAILED, and CANCELLED. *

*/ private String state; /** *

* The name of the crawler to which this condition applies. *

*/ private String crawlerName; /** *

* The state of the crawler to which this condition applies. *

*/ private String crawlState; /** *

* A logical operator. *

* * @param logicalOperator * A logical operator. * @see LogicalOperator */ public void setLogicalOperator(String logicalOperator) { this.logicalOperator = logicalOperator; } /** *

* A logical operator. *

* * @return A logical operator. * @see LogicalOperator */ public String getLogicalOperator() { return this.logicalOperator; } /** *

* A logical operator. *

* * @param logicalOperator * A logical operator. * @return Returns a reference to this object so that method calls can be chained together. * @see LogicalOperator */ public Condition withLogicalOperator(String logicalOperator) { setLogicalOperator(logicalOperator); return this; } /** *

* A logical operator. *

* * @param logicalOperator * A logical operator. * @return Returns a reference to this object so that method calls can be chained together. * @see LogicalOperator */ public Condition withLogicalOperator(LogicalOperator logicalOperator) { this.logicalOperator = logicalOperator.toString(); return this; } /** *

* The name of the job whose JobRuns this condition applies to, and on which this trigger waits. *

* * @param jobName * The name of the job whose JobRuns this condition applies to, and on which this trigger waits. */ public void setJobName(String jobName) { this.jobName = jobName; } /** *

* The name of the job whose JobRuns this condition applies to, and on which this trigger waits. *

* * @return The name of the job whose JobRuns this condition applies to, and on which this trigger * waits. */ public String getJobName() { return this.jobName; } /** *

* The name of the job whose JobRuns this condition applies to, and on which this trigger waits. *

* * @param jobName * The name of the job whose JobRuns this condition applies to, and on which this trigger waits. * @return Returns a reference to this object so that method calls can be chained together. */ public Condition withJobName(String jobName) { setJobName(jobName); return this; } /** *

* The condition state. Currently, the only job states that a trigger can listen for are SUCCEEDED, * STOPPED, FAILED, and TIMEOUT. The only crawler states that a trigger can * listen for are SUCCEEDED, FAILED, and CANCELLED. *

* * @param state * The condition state. Currently, the only job states that a trigger can listen for are * SUCCEEDED, STOPPED, FAILED, and TIMEOUT. The only * crawler states that a trigger can listen for are SUCCEEDED, FAILED, and * CANCELLED. * @see JobRunState */ public void setState(String state) { this.state = state; } /** *

* The condition state. Currently, the only job states that a trigger can listen for are SUCCEEDED, * STOPPED, FAILED, and TIMEOUT. The only crawler states that a trigger can * listen for are SUCCEEDED, FAILED, and CANCELLED. *

* * @return The condition state. Currently, the only job states that a trigger can listen for are * SUCCEEDED, STOPPED, FAILED, and TIMEOUT. The only * crawler states that a trigger can listen for are SUCCEEDED, FAILED, and * CANCELLED. * @see JobRunState */ public String getState() { return this.state; } /** *

* The condition state. Currently, the only job states that a trigger can listen for are SUCCEEDED, * STOPPED, FAILED, and TIMEOUT. The only crawler states that a trigger can * listen for are SUCCEEDED, FAILED, and CANCELLED. *

* * @param state * The condition state. Currently, the only job states that a trigger can listen for are * SUCCEEDED, STOPPED, FAILED, and TIMEOUT. The only * crawler states that a trigger can listen for are SUCCEEDED, FAILED, and * CANCELLED. * @return Returns a reference to this object so that method calls can be chained together. * @see JobRunState */ public Condition withState(String state) { setState(state); return this; } /** *

* The condition state. Currently, the only job states that a trigger can listen for are SUCCEEDED, * STOPPED, FAILED, and TIMEOUT. The only crawler states that a trigger can * listen for are SUCCEEDED, FAILED, and CANCELLED. *

* * @param state * The condition state. Currently, the only job states that a trigger can listen for are * SUCCEEDED, STOPPED, FAILED, and TIMEOUT. The only * crawler states that a trigger can listen for are SUCCEEDED, FAILED, and * CANCELLED. * @return Returns a reference to this object so that method calls can be chained together. * @see JobRunState */ public Condition withState(JobRunState state) { this.state = state.toString(); return this; } /** *

* The name of the crawler to which this condition applies. *

* * @param crawlerName * The name of the crawler to which this condition applies. */ public void setCrawlerName(String crawlerName) { this.crawlerName = crawlerName; } /** *

* The name of the crawler to which this condition applies. *

* * @return The name of the crawler to which this condition applies. */ public String getCrawlerName() { return this.crawlerName; } /** *

* The name of the crawler to which this condition applies. *

* * @param crawlerName * The name of the crawler to which this condition applies. * @return Returns a reference to this object so that method calls can be chained together. */ public Condition withCrawlerName(String crawlerName) { setCrawlerName(crawlerName); return this; } /** *

* The state of the crawler to which this condition applies. *

* * @param crawlState * The state of the crawler to which this condition applies. * @see CrawlState */ public void setCrawlState(String crawlState) { this.crawlState = crawlState; } /** *

* The state of the crawler to which this condition applies. *

* * @return The state of the crawler to which this condition applies. * @see CrawlState */ public String getCrawlState() { return this.crawlState; } /** *

* The state of the crawler to which this condition applies. *

* * @param crawlState * The state of the crawler to which this condition applies. * @return Returns a reference to this object so that method calls can be chained together. * @see CrawlState */ public Condition withCrawlState(String crawlState) { setCrawlState(crawlState); return this; } /** *

* The state of the crawler to which this condition applies. *

* * @param crawlState * The state of the crawler to which this condition applies. * @return Returns a reference to this object so that method calls can be chained together. * @see CrawlState */ public Condition withCrawlState(CrawlState crawlState) { this.crawlState = crawlState.toString(); 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 (getLogicalOperator() != null) sb.append("LogicalOperator: ").append(getLogicalOperator()).append(","); if (getJobName() != null) sb.append("JobName: ").append(getJobName()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getCrawlerName() != null) sb.append("CrawlerName: ").append(getCrawlerName()).append(","); if (getCrawlState() != null) sb.append("CrawlState: ").append(getCrawlState()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Condition == false) return false; Condition other = (Condition) obj; if (other.getLogicalOperator() == null ^ this.getLogicalOperator() == null) return false; if (other.getLogicalOperator() != null && other.getLogicalOperator().equals(this.getLogicalOperator()) == false) return false; if (other.getJobName() == null ^ this.getJobName() == null) return false; if (other.getJobName() != null && other.getJobName().equals(this.getJobName()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getCrawlerName() == null ^ this.getCrawlerName() == null) return false; if (other.getCrawlerName() != null && other.getCrawlerName().equals(this.getCrawlerName()) == false) return false; if (other.getCrawlState() == null ^ this.getCrawlState() == null) return false; if (other.getCrawlState() != null && other.getCrawlState().equals(this.getCrawlState()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLogicalOperator() == null) ? 0 : getLogicalOperator().hashCode()); hashCode = prime * hashCode + ((getJobName() == null) ? 0 : getJobName().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getCrawlerName() == null) ? 0 : getCrawlerName().hashCode()); hashCode = prime * hashCode + ((getCrawlState() == null) ? 0 : getCrawlState().hashCode()); return hashCode; } @Override public Condition clone() { try { return (Condition) 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.ConditionMarshaller.getInstance().marshall(this, protocolMarshaller); } }