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

com.oracle.bmc.tenantmanagercontrolplane.model.Link Maven / Gradle / Ivy

/**
 * Copyright (c) 2016, 2024, Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
 */
package com.oracle.bmc.tenantmanagercontrolplane.model;

/**
 * A link between a parent tenancy and a child tenancy. 
* Note: Objects should always be created or deserialized using the {@link Builder}. This model * distinguishes fields that are {@code null} because they are unset from fields that are explicitly * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a * set of all explicitly set fields called {@link Builder#__explicitlySet__}. The {@link * #hashCode()} and {@link #equals(Object)} methods are implemented to take the explicitly set * fields into account. The constructor, on the other hand, does not take the explicitly set fields * into account (since the constructor cannot distinguish explicit {@code null} from unset {@code * null}). */ @jakarta.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20230401") @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = Link.Builder.class) @com.fasterxml.jackson.annotation.JsonFilter( com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel.EXPLICITLY_SET_FILTER_NAME) public final class Link extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel { @Deprecated @java.beans.ConstructorProperties({ "id", "parentTenancyId", "childTenancyId", "lifecycleState", "timeCreated", "timeUpdated", "timeTerminated" }) public Link( String id, String parentTenancyId, String childTenancyId, LifecycleState lifecycleState, java.util.Date timeCreated, java.util.Date timeUpdated, java.util.Date timeTerminated) { super(); this.id = id; this.parentTenancyId = parentTenancyId; this.childTenancyId = childTenancyId; this.lifecycleState = lifecycleState; this.timeCreated = timeCreated; this.timeUpdated = timeUpdated; this.timeTerminated = timeTerminated; } @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") public static class Builder { /** OCID of the link. */ @com.fasterxml.jackson.annotation.JsonProperty("id") private String id; /** * OCID of the link. * * @param id the value to set * @return this builder */ public Builder id(String id) { this.id = id; this.__explicitlySet__.add("id"); return this; } /** OCID of the parent tenancy. */ @com.fasterxml.jackson.annotation.JsonProperty("parentTenancyId") private String parentTenancyId; /** * OCID of the parent tenancy. * * @param parentTenancyId the value to set * @return this builder */ public Builder parentTenancyId(String parentTenancyId) { this.parentTenancyId = parentTenancyId; this.__explicitlySet__.add("parentTenancyId"); return this; } /** OCID of the child tenancy. */ @com.fasterxml.jackson.annotation.JsonProperty("childTenancyId") private String childTenancyId; /** * OCID of the child tenancy. * * @param childTenancyId the value to set * @return this builder */ public Builder childTenancyId(String childTenancyId) { this.childTenancyId = childTenancyId; this.__explicitlySet__.add("childTenancyId"); return this; } /** Lifecycle state of the link. */ @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") private LifecycleState lifecycleState; /** * Lifecycle state of the link. * * @param lifecycleState the value to set * @return this builder */ public Builder lifecycleState(LifecycleState lifecycleState) { this.lifecycleState = lifecycleState; this.__explicitlySet__.add("lifecycleState"); return this; } /** Date-time when this link was created. */ @com.fasterxml.jackson.annotation.JsonProperty("timeCreated") private java.util.Date timeCreated; /** * Date-time when this link was created. * * @param timeCreated the value to set * @return this builder */ public Builder timeCreated(java.util.Date timeCreated) { this.timeCreated = timeCreated; this.__explicitlySet__.add("timeCreated"); return this; } /** Date-time when this link was last updated. */ @com.fasterxml.jackson.annotation.JsonProperty("timeUpdated") private java.util.Date timeUpdated; /** * Date-time when this link was last updated. * * @param timeUpdated the value to set * @return this builder */ public Builder timeUpdated(java.util.Date timeUpdated) { this.timeUpdated = timeUpdated; this.__explicitlySet__.add("timeUpdated"); return this; } /** Date-time when this link was terminated. */ @com.fasterxml.jackson.annotation.JsonProperty("timeTerminated") private java.util.Date timeTerminated; /** * Date-time when this link was terminated. * * @param timeTerminated the value to set * @return this builder */ public Builder timeTerminated(java.util.Date timeTerminated) { this.timeTerminated = timeTerminated; this.__explicitlySet__.add("timeTerminated"); return this; } @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); public Link build() { Link model = new Link( this.id, this.parentTenancyId, this.childTenancyId, this.lifecycleState, this.timeCreated, this.timeUpdated, this.timeTerminated); for (String explicitlySetProperty : this.__explicitlySet__) { model.markPropertyAsExplicitlySet(explicitlySetProperty); } return model; } @com.fasterxml.jackson.annotation.JsonIgnore public Builder copy(Link model) { if (model.wasPropertyExplicitlySet("id")) { this.id(model.getId()); } if (model.wasPropertyExplicitlySet("parentTenancyId")) { this.parentTenancyId(model.getParentTenancyId()); } if (model.wasPropertyExplicitlySet("childTenancyId")) { this.childTenancyId(model.getChildTenancyId()); } if (model.wasPropertyExplicitlySet("lifecycleState")) { this.lifecycleState(model.getLifecycleState()); } if (model.wasPropertyExplicitlySet("timeCreated")) { this.timeCreated(model.getTimeCreated()); } if (model.wasPropertyExplicitlySet("timeUpdated")) { this.timeUpdated(model.getTimeUpdated()); } if (model.wasPropertyExplicitlySet("timeTerminated")) { this.timeTerminated(model.getTimeTerminated()); } return this; } } /** Create a new builder. */ public static Builder builder() { return new Builder(); } public Builder toBuilder() { return new Builder().copy(this); } /** OCID of the link. */ @com.fasterxml.jackson.annotation.JsonProperty("id") private final String id; /** * OCID of the link. * * @return the value */ public String getId() { return id; } /** OCID of the parent tenancy. */ @com.fasterxml.jackson.annotation.JsonProperty("parentTenancyId") private final String parentTenancyId; /** * OCID of the parent tenancy. * * @return the value */ public String getParentTenancyId() { return parentTenancyId; } /** OCID of the child tenancy. */ @com.fasterxml.jackson.annotation.JsonProperty("childTenancyId") private final String childTenancyId; /** * OCID of the child tenancy. * * @return the value */ public String getChildTenancyId() { return childTenancyId; } /** Lifecycle state of the link. */ @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") private final LifecycleState lifecycleState; /** * Lifecycle state of the link. * * @return the value */ public LifecycleState getLifecycleState() { return lifecycleState; } /** Date-time when this link was created. */ @com.fasterxml.jackson.annotation.JsonProperty("timeCreated") private final java.util.Date timeCreated; /** * Date-time when this link was created. * * @return the value */ public java.util.Date getTimeCreated() { return timeCreated; } /** Date-time when this link was last updated. */ @com.fasterxml.jackson.annotation.JsonProperty("timeUpdated") private final java.util.Date timeUpdated; /** * Date-time when this link was last updated. * * @return the value */ public java.util.Date getTimeUpdated() { return timeUpdated; } /** Date-time when this link was terminated. */ @com.fasterxml.jackson.annotation.JsonProperty("timeTerminated") private final java.util.Date timeTerminated; /** * Date-time when this link was terminated. * * @return the value */ public java.util.Date getTimeTerminated() { return timeTerminated; } @Override public String toString() { return this.toString(true); } /** * Return a string representation of the object. * * @param includeByteArrayContents true to include the full contents of byte arrays * @return string representation */ public String toString(boolean includeByteArrayContents) { java.lang.StringBuilder sb = new java.lang.StringBuilder(); sb.append("Link("); sb.append("super=").append(super.toString()); sb.append("id=").append(String.valueOf(this.id)); sb.append(", parentTenancyId=").append(String.valueOf(this.parentTenancyId)); sb.append(", childTenancyId=").append(String.valueOf(this.childTenancyId)); sb.append(", lifecycleState=").append(String.valueOf(this.lifecycleState)); sb.append(", timeCreated=").append(String.valueOf(this.timeCreated)); sb.append(", timeUpdated=").append(String.valueOf(this.timeUpdated)); sb.append(", timeTerminated=").append(String.valueOf(this.timeTerminated)); sb.append(")"); return sb.toString(); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Link)) { return false; } Link other = (Link) o; return java.util.Objects.equals(this.id, other.id) && java.util.Objects.equals(this.parentTenancyId, other.parentTenancyId) && java.util.Objects.equals(this.childTenancyId, other.childTenancyId) && java.util.Objects.equals(this.lifecycleState, other.lifecycleState) && java.util.Objects.equals(this.timeCreated, other.timeCreated) && java.util.Objects.equals(this.timeUpdated, other.timeUpdated) && java.util.Objects.equals(this.timeTerminated, other.timeTerminated) && super.equals(other); } @Override public int hashCode() { final int PRIME = 59; int result = 1; result = (result * PRIME) + (this.id == null ? 43 : this.id.hashCode()); result = (result * PRIME) + (this.parentTenancyId == null ? 43 : this.parentTenancyId.hashCode()); result = (result * PRIME) + (this.childTenancyId == null ? 43 : this.childTenancyId.hashCode()); result = (result * PRIME) + (this.lifecycleState == null ? 43 : this.lifecycleState.hashCode()); result = (result * PRIME) + (this.timeCreated == null ? 43 : this.timeCreated.hashCode()); result = (result * PRIME) + (this.timeUpdated == null ? 43 : this.timeUpdated.hashCode()); result = (result * PRIME) + (this.timeTerminated == null ? 43 : this.timeTerminated.hashCode()); result = (result * PRIME) + super.hashCode(); return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy