All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.cognitoidentity.model.Credentials Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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.cognitoidentity.model;

import java.io.Serializable;

/**
 * 

* Credentials for the provided identity ID. *

*/ public class Credentials implements Serializable, Cloneable { /** *

* The Access Key portion of the credentials. *

*/ private String accessKeyId; /** *

* The Secret Access Key portion of the credentials *

*/ private String secretKey; /** *

* The Session Token portion of the credentials *

*/ private String sessionToken; /** *

* The date at which these credentials will expire. *

*/ private java.util.Date expiration; /** *

* The Access Key portion of the credentials. *

* * @param accessKeyId * The Access Key portion of the credentials. */ public void setAccessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; } /** *

* The Access Key portion of the credentials. *

* * @return The Access Key portion of the credentials. */ public String getAccessKeyId() { return this.accessKeyId; } /** *

* The Access Key portion of the credentials. *

* * @param accessKeyId * The Access Key portion of the credentials. * @return Returns a reference to this object so that method calls can be * chained together. */ public Credentials withAccessKeyId(String accessKeyId) { setAccessKeyId(accessKeyId); return this; } /** *

* The Secret Access Key portion of the credentials *

* * @param secretKey * The Secret Access Key portion of the credentials */ public void setSecretKey(String secretKey) { this.secretKey = secretKey; } /** *

* The Secret Access Key portion of the credentials *

* * @return The Secret Access Key portion of the credentials */ public String getSecretKey() { return this.secretKey; } /** *

* The Secret Access Key portion of the credentials *

* * @param secretKey * The Secret Access Key portion of the credentials * @return Returns a reference to this object so that method calls can be * chained together. */ public Credentials withSecretKey(String secretKey) { setSecretKey(secretKey); return this; } /** *

* The Session Token portion of the credentials *

* * @param sessionToken * The Session Token portion of the credentials */ public void setSessionToken(String sessionToken) { this.sessionToken = sessionToken; } /** *

* The Session Token portion of the credentials *

* * @return The Session Token portion of the credentials */ public String getSessionToken() { return this.sessionToken; } /** *

* The Session Token portion of the credentials *

* * @param sessionToken * The Session Token portion of the credentials * @return Returns a reference to this object so that method calls can be * chained together. */ public Credentials withSessionToken(String sessionToken) { setSessionToken(sessionToken); return this; } /** *

* The date at which these credentials will expire. *

* * @param expiration * The date at which these credentials will expire. */ public void setExpiration(java.util.Date expiration) { this.expiration = expiration; } /** *

* The date at which these credentials will expire. *

* * @return The date at which these credentials will expire. */ public java.util.Date getExpiration() { return this.expiration; } /** *

* The date at which these credentials will expire. *

* * @param expiration * The date at which these credentials will expire. * @return Returns a reference to this object so that method calls can be * chained together. */ public Credentials withExpiration(java.util.Date expiration) { setExpiration(expiration); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAccessKeyId() != null) sb.append("AccessKeyId: " + getAccessKeyId() + ","); if (getSecretKey() != null) sb.append("SecretKey: " + getSecretKey() + ","); if (getSessionToken() != null) sb.append("SessionToken: " + getSessionToken() + ","); if (getExpiration() != null) sb.append("Expiration: " + getExpiration()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Credentials == false) return false; Credentials other = (Credentials) obj; if (other.getAccessKeyId() == null ^ this.getAccessKeyId() == null) return false; if (other.getAccessKeyId() != null && other.getAccessKeyId().equals(this.getAccessKeyId()) == false) return false; if (other.getSecretKey() == null ^ this.getSecretKey() == null) return false; if (other.getSecretKey() != null && other.getSecretKey().equals(this.getSecretKey()) == false) return false; if (other.getSessionToken() == null ^ this.getSessionToken() == null) return false; if (other.getSessionToken() != null && other.getSessionToken().equals(this.getSessionToken()) == false) return false; if (other.getExpiration() == null ^ this.getExpiration() == null) return false; if (other.getExpiration() != null && other.getExpiration().equals(this.getExpiration()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAccessKeyId() == null) ? 0 : getAccessKeyId().hashCode()); hashCode = prime * hashCode + ((getSecretKey() == null) ? 0 : getSecretKey().hashCode()); hashCode = prime * hashCode + ((getSessionToken() == null) ? 0 : getSessionToken() .hashCode()); hashCode = prime * hashCode + ((getExpiration() == null) ? 0 : getExpiration().hashCode()); return hashCode; } @Override public Credentials clone() { try { return (Credentials) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy