org.odpi.openmetadata.commonservices.ffdc.rest.PropertiesResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ffdc-services Show documentation
Show all versions of ffdc-services Show documentation
Common services for First-Failure Data Capture (FFDC).
The newest version!
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.commonservices.ffdc.rest;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Map;
import java.util.Objects;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
/**
* PropertiesResponse is the response structure used on REST API calls that return a
* property map object as a response.
*/
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
public class PropertiesResponse extends FFDCResponseBase
{
private Map properties = null;
/**
* Default constructor
*/
public PropertiesResponse()
{
super();
}
/**
* Copy/clone constructor
*
* @param template object to copy
*/
public PropertiesResponse(PropertiesResponse template)
{
super(template);
if (template != null)
{
this.properties = template.getProperties();
}
}
/**
* Return the property map.
*
* @return property map
*/
public Map getProperties()
{
if (properties == null)
{
return null;
}
else if (properties.isEmpty())
{
return null;
}
else
{
return properties;
}
}
/**
* Set up the property map.
*
* @param properties property map
*/
public void setProperties(Map properties)
{
this.properties = properties;
}
/**
* JSON-style toString
*
* @return return string containing the property names and values
*/
@Override
public String toString()
{
return "PropertiesResponse{" +
"properties=" + properties +
"} " + super.toString();
}
/**
* Return comparison result based on the content of the properties.
*
* @param objectToCompare test object
* @return result of comparison
*/
@Override
public boolean equals(Object objectToCompare)
{
if (this == objectToCompare)
{
return true;
}
if (!(objectToCompare instanceof PropertiesResponse that))
{
return false;
}
if (!super.equals(objectToCompare))
{
return false;
}
return Objects.equals(getProperties(), that.getProperties());
}
/**
* Return hash code for this object
*
* @return int hash code
*/
@Override
public int hashCode()
{
if (properties == null)
{
return super.hashCode();
}
else
{
return properties.hashCode();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy