Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.identitymanagement.model;
 

Contains information about a version of a managed policy.

This data type is used as a response element in the CreatePolicyVersion, GetPolicyVersion, ListPolicyVersions, and GetAccountAuthorizationDetails actions.

For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.

 
 public class PolicyVersion implements SerializableCloneable {

    
The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

 
     private String document;

    
The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

Constraints:
Pattern: v[1-9][0-9]*(\.[A-Za-z0-9-]*)?

 
     private String versionId;

    
Specifies whether the policy version is set as the policy's default version.
 
     private Boolean isDefaultVersion;

    
The date and time, in ISO 8601 date-time format, when the policy version was created.
 
     private java.util.Date createDate;

    
The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Returns:
The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

 
     public String getDocument() {
         return ;
     }
    
    
The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
document The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

    public void setDocument(String document) {
        this. = document;
    }
    
    
The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
document The policy document.

The policy document is returned in the response to the GetPolicyVersion operation. It is not included in the response to the ListPolicyVersions or GetAccountAuthorizationDetails operations.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PolicyVersion withDocument(String document) {
        this. = document;
        return this;
    }

    
The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

Constraints:
Pattern: v[1-9][0-9]*(\.[A-Za-z0-9-]*)?

Returns:
The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

    public String getVersionId() {
        return ;
    }
    
    
The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

Constraints:
Pattern: v[1-9][0-9]*(\.[A-Za-z0-9-]*)?

Parameters:
versionId The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

    public void setVersionId(String versionId) {
        this. = versionId;
    }
    
    
The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: v[1-9][0-9]*(\.[A-Za-z0-9-]*)?

Parameters:
versionId The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PolicyVersion withVersionId(String versionId) {
        this. = versionId;
        return this;
    }

    
Specifies whether the policy version is set as the policy's default version.

Returns:
Specifies whether the policy version is set as the policy's default version.
    public Boolean isDefaultVersion() {
        return ;
    }
    
    
Specifies whether the policy version is set as the policy's default version.

Parameters:
isDefaultVersion Specifies whether the policy version is set as the policy's default version.
    public void setIsDefaultVersion(Boolean isDefaultVersion) {
        this. = isDefaultVersion;
    }
    
    
Specifies whether the policy version is set as the policy's default version.

Returns a reference to this object so that method calls can be chained together.

Parameters:
isDefaultVersion Specifies whether the policy version is set as the policy's default version.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PolicyVersion withIsDefaultVersion(Boolean isDefaultVersion) {
        this. = isDefaultVersion;
        return this;
    }

    
Specifies whether the policy version is set as the policy's default version.

Returns:
Specifies whether the policy version is set as the policy's default version.
    public Boolean getIsDefaultVersion() {
        return ;
    }

    
The date and time, in ISO 8601 date-time format, when the policy version was created.

Returns:
The date and time, in ISO 8601 date-time format, when the policy version was created.
    public java.util.Date getCreateDate() {
        return ;
    }
    
    
The date and time, in ISO 8601 date-time format, when the policy version was created.

Parameters:
createDate The date and time, in ISO 8601 date-time format, when the policy version was created.
    public void setCreateDate(java.util.Date createDate) {
        this. = createDate;
    }
    
    
The date and time, in ISO 8601 date-time format, when the policy version was created.

Returns a reference to this object so that method calls can be chained together.

Parameters:
createDate The date and time, in ISO 8601 date-time format, when the policy version was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PolicyVersion withCreateDate(java.util.Date createDate) {
        this. = createDate;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDocument() != nullsb.append("Document: " + getDocument() + ",");
        if (getVersionId() != nullsb.append("VersionId: " + getVersionId() + ",");
        if (isDefaultVersion() != nullsb.append("IsDefaultVersion: " + isDefaultVersion() + ",");
        if (getCreateDate() != nullsb.append("CreateDate: " + getCreateDate() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDocument() == null) ? 0 : getDocument().hashCode()); 
        hashCode = prime * hashCode + ((getVersionId() == null) ? 0 : getVersionId().hashCode()); 
        hashCode = prime * hashCode + ((isDefaultVersion() == null) ? 0 : isDefaultVersion().hashCode()); 
        hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PolicyVersion == falsereturn false;
        PolicyVersion other = (PolicyVersion)obj;
        
        if (other.getDocument() == null ^ this.getDocument() == nullreturn false;
        if (other.getDocument() != null && other.getDocument().equals(this.getDocument()) == falsereturn false
        if (other.getVersionId() == null ^ this.getVersionId() == nullreturn false;
        if (other.getVersionId() != null && other.getVersionId().equals(this.getVersionId()) == falsereturn false
        if (other.isDefaultVersion() == null ^ this.isDefaultVersion() == nullreturn false;
        if (other.isDefaultVersion() != null && other.isDefaultVersion().equals(this.isDefaultVersion()) == falsereturn false
        if (other.getCreateDate() == null ^ this.getCreateDate() == nullreturn false;
        if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == falsereturn false
        return true;
    }
    
    @Override
    public PolicyVersion clone() {
        try {
            return (PolicyVersionsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X