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.kms.model;
 
 
 public class CreateGrantResult implements SerializableCloneable {

    
The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.

Constraints:
Length: 1 - 8192

 
     private String grantToken;

    
Unique grant identifier. You can use the GrantId value to revoke a grant.

Constraints:
Length: 1 - 128

 
     private String grantId;

    
The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.

Constraints:
Length: 1 - 8192

Returns:
The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.
 
     public String getGrantToken() {
         return ;
     }
    
    
The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.

Constraints:
Length: 1 - 8192

Parameters:
grantToken The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.
 
     public void setGrantToken(String grantToken) {
         this. = grantToken;
     }
    
    
The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.

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

Constraints:
Length: 1 - 8192

Parameters:
grantToken The grant token. A grant token is a string that identifies a grant and which can be used to make a grant take effect immediately. A token contains all of the information necessary to create a grant.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateGrantResult withGrantToken(String grantToken) {
         this. = grantToken;
         return this;
     }

    
Unique grant identifier. You can use the GrantId value to revoke a grant.

Constraints:
Length: 1 - 128

Returns:
Unique grant identifier. You can use the GrantId value to revoke a grant.
    public String getGrantId() {
        return ;
    }
    
    
Unique grant identifier. You can use the GrantId value to revoke a grant.

Constraints:
Length: 1 - 128

Parameters:
grantId Unique grant identifier. You can use the GrantId value to revoke a grant.
    public void setGrantId(String grantId) {
        this. = grantId;
    }
    
    
Unique grant identifier. You can use the GrantId value to revoke a grant.

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

Constraints:
Length: 1 - 128

Parameters:
grantId Unique grant identifier. You can use the GrantId value to revoke a grant.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateGrantResult withGrantId(String grantId) {
        this. = grantId;
        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 (getGrantToken() != nullsb.append("GrantToken: " + getGrantToken() + ",");
        if (getGrantId() != nullsb.append("GrantId: " + getGrantId() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getGrantToken() == null) ? 0 : getGrantToken().hashCode()); 
        hashCode = prime * hashCode + ((getGrantId() == null) ? 0 : getGrantId().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateGrantResult == falsereturn false;
        CreateGrantResult other = (CreateGrantResult)obj;
        
        if (other.getGrantToken() == null ^ this.getGrantToken() == nullreturn false;
        if (other.getGrantToken() != null && other.getGrantToken().equals(this.getGrantToken()) == falsereturn false
        if (other.getGrantId() == null ^ this.getGrantId() == nullreturn false;
        if (other.getGrantId() != null && other.getGrantId().equals(this.getGrantId()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateGrantResult clone() {
        try {
            return (CreateGrantResultsuper.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