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

* Represents a node in a directed acyclic graph (DAG) *

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

* A node identifier that is unique within the node's graph. *

*/ private String id; /** *

* The type of node that this is. *

*/ private String nodeType; /** *

* Properties of the node, in the form of name-value pairs. *

*/ private java.util.List args; /** *

* The line number of the node. *

*/ private Integer lineNumber; /** *

* A node identifier that is unique within the node's graph. *

* * @param id * A node identifier that is unique within the node's graph. */ public void setId(String id) { this.id = id; } /** *

* A node identifier that is unique within the node's graph. *

* * @return A node identifier that is unique within the node's graph. */ public String getId() { return this.id; } /** *

* A node identifier that is unique within the node's graph. *

* * @param id * A node identifier that is unique within the node's graph. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeGenNode withId(String id) { setId(id); return this; } /** *

* The type of node that this is. *

* * @param nodeType * The type of node that this is. */ public void setNodeType(String nodeType) { this.nodeType = nodeType; } /** *

* The type of node that this is. *

* * @return The type of node that this is. */ public String getNodeType() { return this.nodeType; } /** *

* The type of node that this is. *

* * @param nodeType * The type of node that this is. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeGenNode withNodeType(String nodeType) { setNodeType(nodeType); return this; } /** *

* Properties of the node, in the form of name-value pairs. *

* * @return Properties of the node, in the form of name-value pairs. */ public java.util.List getArgs() { return args; } /** *

* Properties of the node, in the form of name-value pairs. *

* * @param args * Properties of the node, in the form of name-value pairs. */ public void setArgs(java.util.Collection args) { if (args == null) { this.args = null; return; } this.args = new java.util.ArrayList(args); } /** *

* Properties of the node, in the form of name-value pairs. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setArgs(java.util.Collection)} or {@link #withArgs(java.util.Collection)} if you want to override the * existing values. *

* * @param args * Properties of the node, in the form of name-value pairs. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeGenNode withArgs(CodeGenNodeArg... args) { if (this.args == null) { setArgs(new java.util.ArrayList(args.length)); } for (CodeGenNodeArg ele : args) { this.args.add(ele); } return this; } /** *

* Properties of the node, in the form of name-value pairs. *

* * @param args * Properties of the node, in the form of name-value pairs. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeGenNode withArgs(java.util.Collection args) { setArgs(args); return this; } /** *

* The line number of the node. *

* * @param lineNumber * The line number of the node. */ public void setLineNumber(Integer lineNumber) { this.lineNumber = lineNumber; } /** *

* The line number of the node. *

* * @return The line number of the node. */ public Integer getLineNumber() { return this.lineNumber; } /** *

* The line number of the node. *

* * @param lineNumber * The line number of the node. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeGenNode withLineNumber(Integer lineNumber) { setLineNumber(lineNumber); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getNodeType() != null) sb.append("NodeType: ").append(getNodeType()).append(","); if (getArgs() != null) sb.append("Args: ").append(getArgs()).append(","); if (getLineNumber() != null) sb.append("LineNumber: ").append(getLineNumber()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CodeGenNode == false) return false; CodeGenNode other = (CodeGenNode) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getNodeType() == null ^ this.getNodeType() == null) return false; if (other.getNodeType() != null && other.getNodeType().equals(this.getNodeType()) == false) return false; if (other.getArgs() == null ^ this.getArgs() == null) return false; if (other.getArgs() != null && other.getArgs().equals(this.getArgs()) == false) return false; if (other.getLineNumber() == null ^ this.getLineNumber() == null) return false; if (other.getLineNumber() != null && other.getLineNumber().equals(this.getLineNumber()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getNodeType() == null) ? 0 : getNodeType().hashCode()); hashCode = prime * hashCode + ((getArgs() == null) ? 0 : getArgs().hashCode()); hashCode = prime * hashCode + ((getLineNumber() == null) ? 0 : getLineNumber().hashCode()); return hashCode; } @Override public CodeGenNode clone() { try { return (CodeGenNode) 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.CodeGenNodeMarshaller.getInstance().marshall(this, protocolMarshaller); } }