org.odpi.openmetadata.accessservices.digitalarchitecture.properties.LocationProperties Maven / Gradle / Ivy
/* SPDX-License-Identifier: Apache 2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.digitalarchitecture.properties;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Objects;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
/**
* LocationProperties is a class for representing a generic location.
*/
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
public class LocationProperties extends ReferenceableProperties
{
private static final long serialVersionUID = 1L;
private String displayName = null;
private String description = null;
/**
* Default constructor
*/
public LocationProperties()
{
super();
}
/**
* Copy/clone constructor.
*
* @param template object to copy
*/
public LocationProperties(LocationProperties template)
{
super(template);
if (template != null)
{
displayName = template.getDisplayName();
description = template.getDescription();
}
}
/**
* Return a human memorable name for the location.
*
* @return string name
*/
public String getDisplayName()
{
return displayName;
}
/**
* Set up a human memorable name for the location.
*
* @param displayName string name
*/
public void setDisplayName(String displayName)
{
this.displayName = displayName;
}
/**
* Return the description of the location.
*
* @return string text
*/
public String getDescription()
{
return description;
}
/**
* Set up the description of the location.
*
* @param description string text
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* Standard toString method.
*
* @return print out of variables in a JSON-style
*/
@Override
public String toString()
{
return "LocationProperties{" +
"displayName='" + displayName + '\'' +
", description='" + description + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", 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 == null || getClass() != objectToCompare.getClass())
{
return false;
}
if (!super.equals(objectToCompare))
{
return false;
}
LocationProperties that = (LocationProperties) objectToCompare;
return Objects.equals(displayName, that.displayName) &&
Objects.equals(description, that.description);
}
/**
* Return has code based on properties.
*
* @return int
*/
@Override
public int hashCode()
{
return Objects.hash(super.hashCode(), displayName, description);
}
}