com.arm.mbed.cloud.sdk.security.model.CertificateIssuerConfig Maven / Gradle / Ivy
Show all versions of mbed-cloud-sdk Show documentation
// This file was generated by the Pelion SDK foundation code generator.
// This is an autogenerated model class. Do not modify its content as modifications will be lost at next code generation.
package com.arm.mbed.cloud.sdk.security.model;
import java.util.Date;
import com.arm.mbed.cloud.sdk.annotations.Internal;
import com.arm.mbed.cloud.sdk.annotations.Preamble;
import com.arm.mbed.cloud.sdk.annotations.Required;
import com.arm.mbed.cloud.sdk.common.SdkModel;
/**
* Model for CertificateIssuerConfig.
*/
@Preamble(description = "Model for CertificateIssuerConfig.")
public class CertificateIssuerConfig implements SdkModel {
/**
* Serialisation Id.
*/
private static final long serialVersionUID = 5823939683518209L;
/**
* The ID of the certificate issuer. Null if Device Management internal HSM is used.
*/
@Required
private String certificateIssuerId;
/**
* Created UTC time RFC3339.
*/
private Date createdAt;
/**
* The ID of the certificate issuer configuration.
*/
private String id;
/**
* The certificate name to which the certificate issuer configuration applies.
*/
@Required
private String certificateReference;
/**
* Updated UTC time RFC3339.
*/
private Date updatedAt;
/**
* Internal constructor.
*
* Note: Should not be used. Use {@link #CertificateIssuerConfig()} instead.
*
* @param certificateIssuerId
* The ID of the certificate issuer. Null if Device Management internal HSM is used.
*
* @param createdAt
* Created UTC time RFC3339.
* @param id
* The ID of the certificate issuer configuration.
*
* @param reference
* The certificate name to which the certificate issuer configuration applies.
* @param updatedAt
* Updated UTC time RFC3339.
*/
@Internal
public CertificateIssuerConfig(String certificateIssuerId, Date createdAt, String id, String reference,
Date updatedAt) {
super();
setCertificateIssuerId(certificateIssuerId);
setCreatedAt(createdAt);
setId(id);
setCertificateReference(reference);
setUpdatedAt(updatedAt);
}
/**
* Internal constructor.
*
* Note: Should not be used. Use {@link #CertificateIssuerConfig()} instead.
*
* @param certificateIssuerConfig
* a certificateissuerconfig.
*/
@Internal
public CertificateIssuerConfig(CertificateIssuerConfig certificateIssuerConfig) {
this(certificateIssuerConfig == null ? null : certificateIssuerConfig.certificateIssuerId,
certificateIssuerConfig == null ? new Date() : certificateIssuerConfig.createdAt,
certificateIssuerConfig == null ? null : certificateIssuerConfig.id,
certificateIssuerConfig == null ? null : certificateIssuerConfig.certificateReference,
certificateIssuerConfig == null ? new Date() : certificateIssuerConfig.updatedAt);
}
/**
* Constructor.
*/
public CertificateIssuerConfig() {
this(null, new Date(), null, null, new Date());
}
/**
* Constructor.
*
* @param id
* The ID of the certificate issuer configuration.
*
*/
public CertificateIssuerConfig(String id) {
this();
setId(id);
}
/**
* Gets the id of the certificate issuer. null if device management internal hsm is used.
*
* @return certificateIssuerId
*/
public String getCertificateIssuerId() {
return certificateIssuerId;
}
/**
* Sets the id of the certificate issuer. null if device management internal hsm is used.
*
* @param certificateIssuerId
* The ID of the certificate issuer. Null if Device Management internal HSM is used.
*
*/
@Required
public void setCertificateIssuerId(String certificateIssuerId) {
this.certificateIssuerId = certificateIssuerId;
}
/**
* Gets created utc time rfc3339.
*
* @return createdAt
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* Sets created utc time rfc3339.
*
* @param createdAt
* Created UTC time RFC3339.
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* Gets the id of the certificate issuer configuration.
*
* @return id
*/
@Override
public String getId() {
return id;
}
/**
* Sets the id of the certificate issuer configuration.
*
* @param id
* The ID of the certificate issuer configuration.
*
*/
public void setId(String id) {
this.id = id;
}
/**
* Sets the id of the certificate issuer configuration.
*
* Similar to {@link #setId(String)}.
*
* @param certificateissuerconfigId
* The ID of the certificate issuer configuration.
*
*/
@Internal
public void setCertificateissuerconfigId(String certificateissuerconfigId) {
setId(certificateissuerconfigId);
}
/**
* Gets the certificate name to which the certificate issuer configuration applies.
*
* @return reference
*/
public String getCertificateReference() {
return certificateReference;
}
/**
* Sets the certificate name to which the certificate issuer configuration applies.
*
* @param reference
* The certificate name to which the certificate issuer configuration applies.
*/
@Required
public void setCertificateReference(String reference) {
this.certificateReference = reference;
}
/**
* Gets updated utc time rfc3339.
*
* @return updatedAt
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* Sets updated utc time rfc3339.
*
* @param updatedAt
* Updated UTC time RFC3339.
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* Calculates the hash code of this instance based on field values.
*
*
* @see java.lang.Object#hashCode()
* @return hash code
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((certificateIssuerId == null) ? 0 : certificateIssuerId.hashCode());
result = prime * result + ((createdAt == null) ? 0 : createdAt.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((certificateReference == null) ? 0 : certificateReference.hashCode());
result = prime * result + ((updatedAt == null) ? 0 : updatedAt.hashCode());
return result;
}
/**
* Indicates whether some other object is "equal to" this one.
*
*
* @see java.lang.Object#equals(java.lang.Object)
* @param obj
* an object to compare with this instance.
* @return true if this object is the same as the obj argument; false otherwise.
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CertificateIssuerConfig other = (CertificateIssuerConfig) obj;
if (certificateIssuerId == null) {
if (other.certificateIssuerId != null) {
return false;
}
} else if (!certificateIssuerId.equals(other.certificateIssuerId)) {
return false;
}
if (createdAt == null) {
if (other.createdAt != null) {
return false;
}
} else if (!createdAt.equals(other.createdAt)) {
return false;
}
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
if (certificateReference == null) {
if (other.certificateReference != null) {
return false;
}
} else if (!certificateReference.equals(other.certificateReference)) {
return false;
}
if (updatedAt == null) {
if (other.updatedAt != null) {
return false;
}
} else if (!updatedAt.equals(other.updatedAt)) {
return false;
}
return true;
}
/**
* Returns a string representation of the object.
*
*
* @see java.lang.Object#toString()
* @return the string representation
*/
@Override
public String toString() {
return "CertificateIssuerConfig [certificateIssuerId=" + certificateIssuerId + ", createdAt=" + createdAt
+ ", id=" + id + ", reference=" + certificateReference + ", updatedAt=" + updatedAt + "]";
}
/**
* Checks whether the model is valid or not.
*
*
* @see SdkModel#isValid()
* @return true if the model is valid; false otherwise.
*/
@Override
public boolean isValid() {
return certificateIssuerId != null && certificateReference != null;
}
/**
* Clones this instance.
*
*
* @see java.lang.Object#clone()
* @return something
*/
@Override
public CertificateIssuerConfig clone() {
return new CertificateIssuerConfig(this);
}
}