* Information about the stack. *
*/ private Stack stack; /** ** Information about the stack. *
* * @param stack * Information about the stack. */ public void setStack(Stack stack) { this.stack = stack; } /** ** Information about the stack. *
* * @return Information about the stack. */ public Stack getStack() { return this.stack; } /** ** Information about the stack. *
* * @param stack * Information about the stack. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackResult withStack(Stack stack) { setStack(stack); 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 (getStack() != null) sb.append("Stack: ").append(getStack()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateStackResult == false) return false; CreateStackResult other = (CreateStackResult) obj; if (other.getStack() == null ^ this.getStack() == null) return false; if (other.getStack() != null && other.getStack().equals(this.getStack()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStack() == null) ? 0 : getStack().hashCode()); return hashCode; } @Override public CreateStackResult clone() { try { return (CreateStackResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }