com.amazonaws.services.workspacesweb.model.Certificate Maven / Gradle / Ivy
Show all versions of aws-java-sdk-workspacesweb Show documentation
/*
* Copyright 2017-2022 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.workspacesweb.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The certificate.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Certificate implements Serializable, Cloneable, StructuredPojo {
/**
*
* The body of the certificate.
*
*/
private java.nio.ByteBuffer body;
/**
*
* The entity that issued the certificate.
*
*/
private String issuer;
/**
*
* The certificate is not valid after this date.
*
*/
private java.util.Date notValidAfter;
/**
*
* The certificate is not valid before this date.
*
*/
private java.util.Date notValidBefore;
/**
*
* The entity the certificate belongs to.
*
*/
private String subject;
/**
*
* A hexadecimal identifier for the certificate.
*
*/
private String thumbprint;
/**
*
* The body of the certificate.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param body
* The body of the certificate.
*/
public void setBody(java.nio.ByteBuffer body) {
this.body = body;
}
/**
*
* The body of the certificate.
*
*
* {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
* using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
* {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
* Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
* {@code position}.
*
*
* @return The body of the certificate.
*/
public java.nio.ByteBuffer getBody() {
return this.body;
}
/**
*
* The body of the certificate.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param body
* The body of the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Certificate withBody(java.nio.ByteBuffer body) {
setBody(body);
return this;
}
/**
*
* The entity that issued the certificate.
*
*
* @param issuer
* The entity that issued the certificate.
*/
public void setIssuer(String issuer) {
this.issuer = issuer;
}
/**
*
* The entity that issued the certificate.
*
*
* @return The entity that issued the certificate.
*/
public String getIssuer() {
return this.issuer;
}
/**
*
* The entity that issued the certificate.
*
*
* @param issuer
* The entity that issued the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Certificate withIssuer(String issuer) {
setIssuer(issuer);
return this;
}
/**
*
* The certificate is not valid after this date.
*
*
* @param notValidAfter
* The certificate is not valid after this date.
*/
public void setNotValidAfter(java.util.Date notValidAfter) {
this.notValidAfter = notValidAfter;
}
/**
*
* The certificate is not valid after this date.
*
*
* @return The certificate is not valid after this date.
*/
public java.util.Date getNotValidAfter() {
return this.notValidAfter;
}
/**
*
* The certificate is not valid after this date.
*
*
* @param notValidAfter
* The certificate is not valid after this date.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Certificate withNotValidAfter(java.util.Date notValidAfter) {
setNotValidAfter(notValidAfter);
return this;
}
/**
*
* The certificate is not valid before this date.
*
*
* @param notValidBefore
* The certificate is not valid before this date.
*/
public void setNotValidBefore(java.util.Date notValidBefore) {
this.notValidBefore = notValidBefore;
}
/**
*
* The certificate is not valid before this date.
*
*
* @return The certificate is not valid before this date.
*/
public java.util.Date getNotValidBefore() {
return this.notValidBefore;
}
/**
*
* The certificate is not valid before this date.
*
*
* @param notValidBefore
* The certificate is not valid before this date.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Certificate withNotValidBefore(java.util.Date notValidBefore) {
setNotValidBefore(notValidBefore);
return this;
}
/**
*
* The entity the certificate belongs to.
*
*
* @param subject
* The entity the certificate belongs to.
*/
public void setSubject(String subject) {
this.subject = subject;
}
/**
*
* The entity the certificate belongs to.
*
*
* @return The entity the certificate belongs to.
*/
public String getSubject() {
return this.subject;
}
/**
*
* The entity the certificate belongs to.
*
*
* @param subject
* The entity the certificate belongs to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Certificate withSubject(String subject) {
setSubject(subject);
return this;
}
/**
*
* A hexadecimal identifier for the certificate.
*
*
* @param thumbprint
* A hexadecimal identifier for the certificate.
*/
public void setThumbprint(String thumbprint) {
this.thumbprint = thumbprint;
}
/**
*
* A hexadecimal identifier for the certificate.
*
*
* @return A hexadecimal identifier for the certificate.
*/
public String getThumbprint() {
return this.thumbprint;
}
/**
*
* A hexadecimal identifier for the certificate.
*
*
* @param thumbprint
* A hexadecimal identifier for the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Certificate withThumbprint(String thumbprint) {
setThumbprint(thumbprint);
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 (getBody() != null)
sb.append("Body: ").append(getBody()).append(",");
if (getIssuer() != null)
sb.append("Issuer: ").append(getIssuer()).append(",");
if (getNotValidAfter() != null)
sb.append("NotValidAfter: ").append(getNotValidAfter()).append(",");
if (getNotValidBefore() != null)
sb.append("NotValidBefore: ").append(getNotValidBefore()).append(",");
if (getSubject() != null)
sb.append("Subject: ").append(getSubject()).append(",");
if (getThumbprint() != null)
sb.append("Thumbprint: ").append(getThumbprint());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Certificate == false)
return false;
Certificate other = (Certificate) obj;
if (other.getBody() == null ^ this.getBody() == null)
return false;
if (other.getBody() != null && other.getBody().equals(this.getBody()) == false)
return false;
if (other.getIssuer() == null ^ this.getIssuer() == null)
return false;
if (other.getIssuer() != null && other.getIssuer().equals(this.getIssuer()) == false)
return false;
if (other.getNotValidAfter() == null ^ this.getNotValidAfter() == null)
return false;
if (other.getNotValidAfter() != null && other.getNotValidAfter().equals(this.getNotValidAfter()) == false)
return false;
if (other.getNotValidBefore() == null ^ this.getNotValidBefore() == null)
return false;
if (other.getNotValidBefore() != null && other.getNotValidBefore().equals(this.getNotValidBefore()) == false)
return false;
if (other.getSubject() == null ^ this.getSubject() == null)
return false;
if (other.getSubject() != null && other.getSubject().equals(this.getSubject()) == false)
return false;
if (other.getThumbprint() == null ^ this.getThumbprint() == null)
return false;
if (other.getThumbprint() != null && other.getThumbprint().equals(this.getThumbprint()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
hashCode = prime * hashCode + ((getIssuer() == null) ? 0 : getIssuer().hashCode());
hashCode = prime * hashCode + ((getNotValidAfter() == null) ? 0 : getNotValidAfter().hashCode());
hashCode = prime * hashCode + ((getNotValidBefore() == null) ? 0 : getNotValidBefore().hashCode());
hashCode = prime * hashCode + ((getSubject() == null) ? 0 : getSubject().hashCode());
hashCode = prime * hashCode + ((getThumbprint() == null) ? 0 : getThumbprint().hashCode());
return hashCode;
}
@Override
public Certificate clone() {
try {
return (Certificate) 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.workspacesweb.model.transform.CertificateMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}