/* * 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 for returning a resource policy. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GluePolicy implements Serializable, Cloneable, StructuredPojo { /** ** Contains the requested policy document, in JSON format. *
*/ private String policyInJson; /** ** Contains the hash value associated with this policy. *
*/ private String policyHash; /** ** The date and time at which the policy was created. *
*/ private java.util.Date createTime; /** ** The date and time at which the policy was last updated. *
*/ private java.util.Date updateTime; /** ** Contains the requested policy document, in JSON format. *
* * @param policyInJson * Contains the requested policy document, in JSON format. */ public void setPolicyInJson(String policyInJson) { this.policyInJson = policyInJson; } /** ** Contains the requested policy document, in JSON format. *
* * @return Contains the requested policy document, in JSON format. */ public String getPolicyInJson() { return this.policyInJson; } /** ** Contains the requested policy document, in JSON format. *
* * @param policyInJson * Contains the requested policy document, in JSON format. * @return Returns a reference to this object so that method calls can be chained together. */ public GluePolicy withPolicyInJson(String policyInJson) { setPolicyInJson(policyInJson); return this; } /** ** Contains the hash value associated with this policy. *
* * @param policyHash * Contains the hash value associated with this policy. */ public void setPolicyHash(String policyHash) { this.policyHash = policyHash; } /** ** Contains the hash value associated with this policy. *
* * @return Contains the hash value associated with this policy. */ public String getPolicyHash() { return this.policyHash; } /** ** Contains the hash value associated with this policy. *
* * @param policyHash * Contains the hash value associated with this policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GluePolicy withPolicyHash(String policyHash) { setPolicyHash(policyHash); return this; } /** ** The date and time at which the policy was created. *
* * @param createTime * The date and time at which the policy was created. */ public void setCreateTime(java.util.Date createTime) { this.createTime = createTime; } /** ** The date and time at which the policy was created. *
* * @return The date and time at which the policy was created. */ public java.util.Date getCreateTime() { return this.createTime; } /** ** The date and time at which the policy was created. *
* * @param createTime * The date and time at which the policy was created. * @return Returns a reference to this object so that method calls can be chained together. */ public GluePolicy withCreateTime(java.util.Date createTime) { setCreateTime(createTime); return this; } /** ** The date and time at which the policy was last updated. *
* * @param updateTime * The date and time at which the policy was last updated. */ public void setUpdateTime(java.util.Date updateTime) { this.updateTime = updateTime; } /** ** The date and time at which the policy was last updated. *
* * @return The date and time at which the policy was last updated. */ public java.util.Date getUpdateTime() { return this.updateTime; } /** ** The date and time at which the policy was last updated. *
* * @param updateTime * The date and time at which the policy was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ public GluePolicy withUpdateTime(java.util.Date updateTime) { setUpdateTime(updateTime); 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 (getPolicyInJson() != null) sb.append("PolicyInJson: ").append(getPolicyInJson()).append(","); if (getPolicyHash() != null) sb.append("PolicyHash: ").append(getPolicyHash()).append(","); if (getCreateTime() != null) sb.append("CreateTime: ").append(getCreateTime()).append(","); if (getUpdateTime() != null) sb.append("UpdateTime: ").append(getUpdateTime()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GluePolicy == false) return false; GluePolicy other = (GluePolicy) obj; if (other.getPolicyInJson() == null ^ this.getPolicyInJson() == null) return false; if (other.getPolicyInJson() != null && other.getPolicyInJson().equals(this.getPolicyInJson()) == false) return false; if (other.getPolicyHash() == null ^ this.getPolicyHash() == null) return false; if (other.getPolicyHash() != null && other.getPolicyHash().equals(this.getPolicyHash()) == false) return false; if (other.getCreateTime() == null ^ this.getCreateTime() == null) return false; if (other.getCreateTime() != null && other.getCreateTime().equals(this.getCreateTime()) == false) return false; if (other.getUpdateTime() == null ^ this.getUpdateTime() == null) return false; if (other.getUpdateTime() != null && other.getUpdateTime().equals(this.getUpdateTime()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyInJson() == null) ? 0 : getPolicyInJson().hashCode()); hashCode = prime * hashCode + ((getPolicyHash() == null) ? 0 : getPolicyHash().hashCode()); hashCode = prime * hashCode + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); hashCode = prime * hashCode + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); return hashCode; } @Override public GluePolicy clone() { try { return (GluePolicy) 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.GluePolicyMarshaller.getInstance().marshall(this, protocolMarshaller); } }