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

org.odpi.openmetadata.accessservices.assetowner.properties.AssetProperties Maven / Gradle / Ivy

/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.assetowner.properties;

import com.fasterxml.jackson.annotation.*;

import java.util.*;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;

/**
 * AssetProperties holds asset properties that are used for displaying details of
 * an asset in summary lists or hover text.  It includes the following properties:
 * 
    *
  • type - metadata type information for the asset
  • *
  • guid - globally unique identifier for the asset
  • *
  • url - external link for the asset
  • *
  • qualifiedName - The official (unique) name for the asset. This is often defined by the IT systems * management organization and should be used (when available) on audit logs and error messages. * (qualifiedName from Referenceable - model 0010)
  • *
  • displayName - A consumable name for the asset. Often a shortened form of the assetQualifiedName * for use on user interfaces and messages. The assetDisplayName should only be used for audit logs and error * messages if the assetQualifiedName is not set. (Sourced from attribute name within Asset - model 0010)
  • *
  • shortDescription - short description about the asset. * (Sourced from assetSummary within ConnectionsToAsset - model 0205)
  • *
  • description - full description of the asset. * (Sourced from attribute description within Asset - model 0010)
  • *
  • owner - name of the person or organization that owns the asset. * (Sourced from classification AssetOwnership or Ownership attached to Asset - model 0445)
  • *
  • ownerTypeName - name of the element type identifying the person or organization that owns the asset. * (Sourced from classification AssetOwnership or Ownership attached to Asset - model 0445)
  • *
  • ownerPropertyName - name of the property identifying person or organization that owns the asset. * (Sourced from classification AssetOwnership or Ownership attached to Asset - model 0445)
  • *
  • ownerType - type of the the person or organization that owns the asset. * (Sourced from classification AssetOwnership attached to Asset - model 0445)
  • *
  • zoneMembership - name of the person or organization that owns the asset. * (Sourced from classification AssetZoneMemberShip attached to Asset - model 0424)
  • *
  • origin - origin identifiers describing the source of the asset. * (Sourced from classification AssetOrigin attached to Asset - model 0440)
  • *
  • classifications - list of all classifications assigned to the asset
  • *
  • extendedProperties - list of properties assigned to the asset from the Asset subclasses
  • *
  • additionalProperties - list of properties assigned to the asset as additional properties
  • *
*/ @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 = DataStoreProperties.class, name = "DataStoreProperties"), }) public class AssetProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; private String displayName = null; private String description = null; private String owner = null; private OwnerType ownerType = null; private String ownerTypeName = null; private String ownerPropertyName = null; private List zoneMembership = null; private String originOrganizationGUID = null; private String originBusinessCapabilityGUID = null; private Map otherOriginValues = null; /** * Default constructor */ public AssetProperties() { } /** * Copy/clone constructor. Note, this is a deep copy * * @param template object to copy */ public AssetProperties(AssetProperties template) { super(template); if (template != null) { displayName = template.getDisplayName(); description = template.getDescription(); owner = template.getOwner(); ownerTypeName = template.getOwnerTypeName(); ownerPropertyName = template.getOwnerPropertyName(); ownerType = template.getOwnerType(); zoneMembership = template.getZoneMembership(); originOrganizationGUID = template.getOriginOrganizationGUID(); originBusinessCapabilityGUID = template.getOriginBusinessCapabilityGUID(); otherOriginValues = template.getOtherOriginValues(); } } /** * Returns the stored display name property for the asset. * If no display name is available then null is returned. * * @return String name */ public String getDisplayName() { return displayName; } /** * Set up the stored display name property for the asset. * * @param displayName String name */ public void setDisplayName(String displayName) { this.displayName = displayName; } /** * Returns the stored description property for the asset. * If no description is provided then null is returned. * * @return description String text */ public String getDescription() { return description; } /** * Set up the stored description property associated with the asset. * * @param description String text */ public void setDescription(String description) { this.description = description; } /** * Returns the name of the owner for this asset. * * @return owner String */ public String getOwner() { return owner; } /** * Set up the name of the owner for this asset. * * @param owner String name */ public void setOwner(String owner) { this.owner = owner; } /** * Returns the name of the type used to identify of the owner for this asset. * * @return owner String */ public String getOwnerTypeName() { return ownerTypeName; } /** * Set up the name of the type used to identify the owner for this asset. * * @param ownerTypeName String name */ public void setOwnerTypeName(String ownerTypeName) { this.ownerTypeName = ownerTypeName; } /** * Returns the property name used to identify the owner for this asset. * * @return owner String */ public String getOwnerPropertyName() { return ownerPropertyName; } /** * Set up the property name used to identify the owner for this asset. * * @param ownerPropertyName String name */ public void setOwnerPropertyName(String ownerPropertyName) { this.ownerPropertyName = ownerPropertyName; } /** * Return the type of owner stored in the owner property. * * @return OwnerType enum */ @Deprecated public OwnerType getOwnerType() { return ownerType; } /** * Set up the owner type for this asset. * * @param ownerType OwnerType enum */ @Deprecated() public void setOwnerType(OwnerType ownerType) { this.ownerType = ownerType; } /** * Return the names of the zones that this asset is a member of. * * @return list of zone names */ public List getZoneMembership() { if (zoneMembership == null) { return null; } else if (zoneMembership.isEmpty()) { return null; } else { return new ArrayList<>(zoneMembership); } } /** * Set up the names of the zones that this asset is a member of. * * @param zoneMembership list of zone names */ public void setZoneMembership(List zoneMembership) { this.zoneMembership = zoneMembership; } /** * Return the unique identifier for the organization that originated this asset. * * @return string guid */ public String getOriginOrganizationGUID() { return originOrganizationGUID; } /** * Set up the unique identifier for the organization that originated this asset. * * @param originOrganizationGUID string guid */ public void setOriginOrganizationGUID(String originOrganizationGUID) { this.originOrganizationGUID = originOrganizationGUID; } /** * Return the unique identifier of the business capability that originated this asset. * * @return string guid */ public String getOriginBusinessCapabilityGUID() { return originBusinessCapabilityGUID; } /** * Set up the unique identifier of the business capability that originated this asset. * * @param originBusinessCapabilityGUID string guid */ public void setOriginBusinessCapabilityGUID(String originBusinessCapabilityGUID) { this.originBusinessCapabilityGUID = originBusinessCapabilityGUID; } /** * Return the properties that characterize where this asset is from. * * @return map of name value pairs, all strings */ public Map getOtherOriginValues() { if (otherOriginValues == null) { return null; } else if (otherOriginValues.isEmpty()) { return null; } else { return new HashMap<>(otherOriginValues); } } /** * Set up the properties that characterize where this asset is from. * * @param otherOriginValues map of name value pairs, all strings */ public void setOtherOriginValues(Map otherOriginValues) { this.otherOriginValues = otherOriginValues; } /** * Standard toString method. * * @return print out of variables in a JSON-style */ @Override public String toString() { return "AssetProperties{" + "displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", owner='" + owner + '\'' + ", ownerTypeName=" + ownerTypeName + ", ownerPropertyName=" + ownerPropertyName+ ", ownerType=" + ownerType + ", zoneMembership=" + zoneMembership + ", originOrganizationGUID='" + originOrganizationGUID + '\'' + ", originBusinessCapabilityGUID='" + originBusinessCapabilityGUID + '\'' + ", otherOriginValues=" + otherOriginValues + ", typeName='" + getTypeName() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", 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; } AssetProperties that = (AssetProperties) objectToCompare; return Objects.equals(displayName, that.displayName) && Objects.equals(description, that.description) && Objects.equals(owner, that.owner) && Objects.equals(ownerTypeName, that.ownerTypeName) && Objects.equals(ownerPropertyName, that.ownerPropertyName) && ownerType == that.ownerType && Objects.equals(zoneMembership, that.zoneMembership) && Objects.equals(originOrganizationGUID, that.originOrganizationGUID) && Objects.equals(originBusinessCapabilityGUID, that.originBusinessCapabilityGUID) && Objects.equals(otherOriginValues, that.otherOriginValues); } /** * Return has code based on properties. * * @return int */ @Override public int hashCode() { return Objects.hash(super.hashCode(), displayName, description, owner, ownerTypeName, ownerPropertyName, ownerType, zoneMembership, originOrganizationGUID, originBusinessCapabilityGUID, otherOriginValues); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy