com.arm.mbed.cloud.sdk.security.model.CertificateEnrollment 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.common.SdkModel;
/**
* Model for CertificateEnrollment.
*/
@Preamble(description = "Model for CertificateEnrollment.")
public class CertificateEnrollment implements SdkModel {
/**
* Serialisation Id.
*/
private static final long serialVersionUID = -174544234335182L;
/**
* The certificate name.
*/
private String certificateName;
/**
* Creation UTC time RFC3339.
*/
private Date createdAt;
/**
* The device ID.
*/
private String deviceId;
private CertificateEnrollmentEnrollResult enrollResult;
private CertificateEnrollmentEnrollStatus enrollStatus;
/**
* The ID of the certificate enrollment.
*/
private String id;
/**
* Update UTC time RFC3339.
*/
private Date updatedAt;
/**
* Internal constructor.
*
* Note: Should not be used. Use {@link #CertificateEnrollment()} instead.
*
* @param certificateName
* The certificate name.
* @param createdAt
* Creation UTC time RFC3339.
* @param deviceId
* The device ID.
* @param enrollResult
* null
* @param enrollStatus
* null
* @param id
* The ID of the certificate enrollment.
* @param updatedAt
* Update UTC time RFC3339.
*/
@Internal
public CertificateEnrollment(String certificateName, Date createdAt, String deviceId,
CertificateEnrollmentEnrollResult enrollResult,
CertificateEnrollmentEnrollStatus enrollStatus, String id, Date updatedAt) {
super();
setCertificateName(certificateName);
setCreatedAt(createdAt);
setDeviceId(deviceId);
setEnrollResult(enrollResult);
setEnrollStatus(enrollStatus);
setId(id);
setUpdatedAt(updatedAt);
}
/**
* Internal constructor.
*
* Note: Should not be used. Use {@link #CertificateEnrollment()} instead.
*
* @param certificateEnrollment
* a certificateenrollment.
*/
@Internal
public CertificateEnrollment(CertificateEnrollment certificateEnrollment) {
this(certificateEnrollment == null ? null : certificateEnrollment.certificateName,
certificateEnrollment == null ? new Date() : certificateEnrollment.createdAt,
certificateEnrollment == null ? null : certificateEnrollment.deviceId,
certificateEnrollment == null ? null : certificateEnrollment.enrollResult,
certificateEnrollment == null ? null : certificateEnrollment.enrollStatus,
certificateEnrollment == null ? null : certificateEnrollment.id,
certificateEnrollment == null ? new Date() : certificateEnrollment.updatedAt);
}
/**
* Constructor.
*/
public CertificateEnrollment() {
this(null, new Date(), null, null, null, null, new Date());
}
/**
* Constructor.
*
* @param id
* The ID of the certificate enrollment.
*/
public CertificateEnrollment(String id) {
this();
setId(id);
}
/**
* Gets the certificate name.
*
* @return certificateName
*/
public String getCertificateName() {
return certificateName;
}
/**
* Sets the certificate name.
*
* @param certificateName
* The certificate name.
*/
public void setCertificateName(String certificateName) {
this.certificateName = certificateName;
}
/**
* Gets creation utc time rfc3339.
*
* @return createdAt
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* Sets creation utc time rfc3339.
*
* @param createdAt
* Creation UTC time RFC3339.
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* Gets the device id.
*
* @return deviceId
*/
public String getDeviceId() {
return deviceId;
}
/**
* Sets the device id.
*
* @param deviceId
* The device ID.
*/
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
/**
* Gets enrollresult.
*
* @return enrollResult
*/
public CertificateEnrollmentEnrollResult getEnrollResult() {
return enrollResult;
}
/**
* Sets enrollresult.
*
* @param enrollResult
* null
*/
public void setEnrollResult(CertificateEnrollmentEnrollResult enrollResult) {
this.enrollResult = enrollResult;
}
/**
* Gets enrollstatus.
*
* @return enrollStatus
*/
public CertificateEnrollmentEnrollStatus getEnrollStatus() {
return enrollStatus;
}
/**
* Sets enrollstatus.
*
* @param enrollStatus
* null
*/
public void setEnrollStatus(CertificateEnrollmentEnrollStatus enrollStatus) {
this.enrollStatus = enrollStatus;
}
/**
* Gets the id of the certificate enrollment.
*
* @return id
*/
@Override
public String getId() {
return id;
}
/**
* Sets the id of the certificate enrollment.
*
* @param id
* The ID of the certificate enrollment.
*/
public void setId(String id) {
this.id = id;
}
/**
* Sets the id of the certificate enrollment.
*
* Similar to {@link #setId(String)}.
*
* @param certificateenrollmentId
* The ID of the certificate enrollment.
*/
@Internal
public void setCertificateenrollmentId(String certificateenrollmentId) {
setId(certificateenrollmentId);
}
/**
* Gets update utc time rfc3339.
*
* @return updatedAt
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* Sets update utc time rfc3339.
*
* @param updatedAt
* Update 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 + ((certificateName == null) ? 0 : certificateName.hashCode());
result = prime * result + ((createdAt == null) ? 0 : createdAt.hashCode());
result = prime * result + ((deviceId == null) ? 0 : deviceId.hashCode());
result = prime * result + ((enrollResult == null) ? 0 : enrollResult.hashCode());
result = prime * result + ((enrollStatus == null) ? 0 : enrollStatus.hashCode());
result = prime * result + ((id == null) ? 0 : id.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().isAssignableFrom(obj.getClass())) {
return false;
}
final CertificateEnrollment other = (CertificateEnrollment) obj;
if (certificateName == null) {
if (other.certificateName != null) {
return false;
}
} else if (!certificateName.equals(other.certificateName)) {
return false;
}
if (createdAt == null) {
if (other.createdAt != null) {
return false;
}
} else if (!createdAt.equals(other.createdAt)) {
return false;
}
if (deviceId == null) {
if (other.deviceId != null) {
return false;
}
} else if (!deviceId.equals(other.deviceId)) {
return false;
}
if (enrollResult == null) {
if (other.enrollResult != null) {
return false;
}
} else if (!enrollResult.equals(other.enrollResult)) {
return false;
}
if (enrollStatus == null) {
if (other.enrollStatus != null) {
return false;
}
} else if (!enrollStatus.equals(other.enrollStatus)) {
return false;
}
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
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 "CertificateEnrollment [certificateName=" + certificateName + ", createdAt=" + createdAt + ", deviceId="
+ deviceId + ", enrollResult=" + enrollResult + ", enrollStatus=" + enrollStatus + ", id=" + id
+ ", 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 true;
}
/**
* Clones this instance.
*
*
* @see java.lang.Object#clone()
* @return something
*/
@Override
public CertificateEnrollment clone() {
return new CertificateEnrollment(this);
}
}