com.huaweicloud.sdk.er.v3.model.Association Maven / Gradle / Ivy
package com.huaweicloud.sdk.er.v3.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Objects;
import java.util.function.Consumer;
/**
* 关联详情
*/
public class Association {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "id")
private String id;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "route_table_id")
private String routeTableId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "attachment_id")
private String attachmentId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "resource_type")
private String resourceType;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "resource_id")
private String resourceId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "state")
private String state;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "created_at")
private OffsetDateTime createdAt;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "updated_at")
private OffsetDateTime updatedAt;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "route_policy")
private ExportRoutePolicy routePolicy;
public Association withId(String id) {
this.id = id;
return this;
}
/**
* 关联唯一标识
* @return id
*/
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Association withRouteTableId(String routeTableId) {
this.routeTableId = routeTableId;
return this;
}
/**
* 路由表唯一标识
* @return routeTableId
*/
public String getRouteTableId() {
return routeTableId;
}
public void setRouteTableId(String routeTableId) {
this.routeTableId = routeTableId;
}
public Association withAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
return this;
}
/**
* 连接唯一标识
* @return attachmentId
*/
public String getAttachmentId() {
return attachmentId;
}
public void setAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
}
public Association withResourceType(String resourceType) {
this.resourceType = resourceType;
return this;
}
/**
* 连接的类型
* @return resourceType
*/
public String getResourceType() {
return resourceType;
}
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public Association withResourceId(String resourceId) {
this.resourceId = resourceId;
return this;
}
/**
* 连接的资源唯一标识
* @return resourceId
*/
public String getResourceId() {
return resourceId;
}
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
public Association withState(String state) {
this.state = state;
return this;
}
/**
* 状态
* @return state
*/
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Association withCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* 资源创建时间 采用UTC时间 格式:YYYY-MM-DDTHH:MM:SS
* @return createdAt
*/
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public Association withUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* 资源更新时间 采用UTC时间 格式:YYYY-MM-DDTHH:MM:SS
* @return updatedAt
*/
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public Association withRoutePolicy(ExportRoutePolicy routePolicy) {
this.routePolicy = routePolicy;
return this;
}
public Association withRoutePolicy(Consumer routePolicySetter) {
if (this.routePolicy == null) {
this.routePolicy = new ExportRoutePolicy();
routePolicySetter.accept(this.routePolicy);
}
return this;
}
/**
* Get routePolicy
* @return routePolicy
*/
public ExportRoutePolicy getRoutePolicy() {
return routePolicy;
}
public void setRoutePolicy(ExportRoutePolicy routePolicy) {
this.routePolicy = routePolicy;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
Association that = (Association) obj;
return Objects.equals(this.id, that.id) && Objects.equals(this.routeTableId, that.routeTableId)
&& Objects.equals(this.attachmentId, that.attachmentId)
&& Objects.equals(this.resourceType, that.resourceType) && Objects.equals(this.resourceId, that.resourceId)
&& Objects.equals(this.state, that.state) && Objects.equals(this.createdAt, that.createdAt)
&& Objects.equals(this.updatedAt, that.updatedAt) && Objects.equals(this.routePolicy, that.routePolicy);
}
@Override
public int hashCode() {
return Objects
.hash(id, routeTableId, attachmentId, resourceType, resourceId, state, createdAt, updatedAt, routePolicy);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Association {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" routeTableId: ").append(toIndentedString(routeTableId)).append("\n");
sb.append(" attachmentId: ").append(toIndentedString(attachmentId)).append("\n");
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" routePolicy: ").append(toIndentedString(routePolicy)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}