org.odpi.openmetadata.accessservices.digitalservice.properties.AgreementProperties Maven / Gradle / Ivy
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.digitalservice.properties;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.util.Objects;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
/**
* AgreementProperties represents the properties of an agreement between two parties.
*/
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "class")
@JsonSubTypes(
{
@JsonSubTypes.Type(value = DigitalSubscriptionProperties.class, name = "DigitalSubscriptionProperties"),
})
public class AgreementProperties extends ReferenceableProperties
{
private String displayName = null;
private String description = null;
private String agreementType = null;
/**
* Default constructor
*/
public AgreementProperties()
{
super();
}
/**
* Copy/clone constructor
*
* @param template object to copy
*/
public AgreementProperties(AgreementProperties template)
{
super(template);
if (template != null)
{
this.agreementType = template.getAgreementType();
this.displayName = template.getDisplayName();
this.description = template.getDescription();
}
}
/**
* Return the display name for this asset (normally a shortened for of the qualified name).
*
* @return string name
*/
public String getDisplayName()
{
return displayName;
}
/**
* Set up the display name for this asset (normally a shortened for of the qualified name).
*
* @param displayName string name
*/
public void setDisplayName(String displayName)
{
this.displayName = displayName;
}
/**
* Return the description for this asset.
*
* @return string description
*/
public String getDescription()
{
return description;
}
/**
* Set up the description for this asset.
*
* @param description string
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* Return the identifier assigned to describe the type of agreement.
*
* @return String
*/
public String getAgreementType()
{
return agreementType;
}
/**
* Set up the identifier assigned to describe the type of agreement.
*
* @param agreementType String
*/
public void setAgreementType(String agreementType)
{
this.agreementType = agreementType;
}
/**
* Standard toString method.
*
* @return print out of variables in a JSON-style
*/
@Override
public String toString()
{
return "AgreementProperties{" +
"displayName='" + displayName + '\'' +
", description='" + description + '\'' +
", agreementType='" + agreementType + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", effectiveFrom=" + getEffectiveFrom() +
", effectiveTo=" + getEffectiveTo() +
", typeName='" + getTypeName() + '\'' +
", extendedProperties=" + getExtendedProperties() +
'}';
}
/**
* Compare the values of the supplied object with those stored in the current object.
*
* @param objectToCompare supplied object
* @return boolean result of comparison
*/
@Override
public boolean equals(Object objectToCompare)
{
if (this == objectToCompare)
{
return true;
}
if (! (objectToCompare instanceof AgreementProperties))
{
return false;
}
if (! super.equals(objectToCompare))
{
return false;
}
AgreementProperties that = (AgreementProperties) objectToCompare;
return Objects.equals(displayName, that.displayName) &&
Objects.equals(description, that.description) && Objects.equals(agreementType, that.agreementType);
}
/**
* Return hash code based on properties.
*
* @return int
*/
@Override
public int hashCode()
{
return Objects.hash(super.hashCode(), displayName, description, agreementType);
}
}