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 the last time an AWS access key was used.

This data type is used as a response element in the GetAccessKeyLastUsed action.

 
 public class AccessKeyLastUsed implements SerializableCloneable {

    
The date and time, in ISO 8601 date-time format, when the access key was most recently used.
 
     private java.util.Date lastUsedDate;

    
The name of the AWS service with which this access key was most recently used.
 
     private String serviceName;

    
The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

 
     private String region;

    
The date and time, in ISO 8601 date-time format, when the access key was most recently used.

Returns:
The date and time, in ISO 8601 date-time format, when the access key was most recently used.
 
     public java.util.Date getLastUsedDate() {
         return ;
     }
    
    
The date and time, in ISO 8601 date-time format, when the access key was most recently used.

Parameters:
lastUsedDate The date and time, in ISO 8601 date-time format, when the access key was most recently used.
 
     public void setLastUsedDate(java.util.Date lastUsedDate) {
         this. = lastUsedDate;
     }
    
    
The date and time, in ISO 8601 date-time format, when the access key was most recently used.

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

Parameters:
lastUsedDate The date and time, in ISO 8601 date-time format, when the access key was most recently used.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public AccessKeyLastUsed withLastUsedDate(java.util.Date lastUsedDate) {
         this. = lastUsedDate;
         return this;
     }

    
The name of the AWS service with which this access key was most recently used.

Returns:
The name of the AWS service with which this access key was most recently used.
 
     public String getServiceName() {
         return ;
     }
    
    
The name of the AWS service with which this access key was most recently used.

Parameters:
serviceName The name of the AWS service with which this access key was most recently used.
    public void setServiceName(String serviceName) {
        this. = serviceName;
    }
    
    
The name of the AWS service with which this access key was most recently used.

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

Parameters:
serviceName The name of the AWS service with which this access key was most recently used.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AccessKeyLastUsed withServiceName(String serviceName) {
        this. = serviceName;
        return this;
    }

    
The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

Returns:
The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

    public String getRegion() {
        return ;
    }
    
    
The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

Parameters:
region The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

    public void setRegion(String region) {
        this. = region;
    }
    
    
The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

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

Parameters:
region The AWS region where this access key was most recently used.

For more information about AWS regions, see Regions and Endpoints in the Amazon Web Services General Reference.

Returns:
A reference to this updated object so that method calls can be chained together.
    public AccessKeyLastUsed withRegion(String region) {
        this. = region;
        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 (getLastUsedDate() != nullsb.append("LastUsedDate: " + getLastUsedDate() + ",");
        if (getServiceName() != nullsb.append("ServiceName: " + getServiceName() + ",");
        if (getRegion() != nullsb.append("Region: " + getRegion() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getLastUsedDate() == null) ? 0 : getLastUsedDate().hashCode()); 
        hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); 
        hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof AccessKeyLastUsed == falsereturn false;
        AccessKeyLastUsed other = (AccessKeyLastUsed)obj;
        
        if (other.getLastUsedDate() == null ^ this.getLastUsedDate() == nullreturn false;
        if (other.getLastUsedDate() != null && other.getLastUsedDate().equals(this.getLastUsedDate()) == falsereturn false
        if (other.getServiceName() == null ^ this.getServiceName() == nullreturn false;
        if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == falsereturn false
        if (other.getRegion() == null ^ this.getRegion() == nullreturn false;
        if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == falsereturn false
        return true;
    }
    
    @Override
    public AccessKeyLastUsed clone() {
        try {
            return (AccessKeyLastUsedsuper.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