Skip to content

Commit

Permalink
Enhance collections support
Browse files Browse the repository at this point in the history
Signed-off-by: Mandy Chessell <[email protected]>
  • Loading branch information
mandy-chessell committed Oct 18, 2023
1 parent 0e9173c commit 6b95f2f
Show file tree
Hide file tree
Showing 117 changed files with 15,763 additions and 1,125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,16 @@ public void setCollectionOrderingProperty(String collectionOrderingProperty)
public String toString()
{
return "CollectionFolderProperties{" +
"collectionOrderingProperty='" + collectionOrderingProperty + '\'' +
", collectionOrdering=" + collectionOrdering +
", name='" + getName() + '\'' +
", description='" + getDescription() + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", typeName='" + getTypeName() + '\'' +
", extendedProperties=" + getExtendedProperties() +
'}';
"collectionOrderingProperty='" + collectionOrderingProperty + '\'' +
", collectionOrdering=" + collectionOrdering +
", name='" + getName() + '\'' +
", description='" + getDescription() + '\'' +
", collectionType='" + getCollectionType() + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", typeName='" + getTypeName() + '\'' +
", extendedProperties=" + getExtendedProperties() +
'}';
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/* 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.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;

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

/**
* CollectionMemberStatus specifies the the status of the member in a collection.
*/
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
public enum CollectionMemberStatus implements Serializable
{
/**
* The status of the member is not known or not specified. This is the default value.
*/
UNKNOWN (0, 0, "Unknown", "The status of the member is not known or not specified. This is the default value."),

/**
* The member was added by a discovery process.
*/
DISCOVERED (1, 1, "Discovered", "The member was added by a discovery process."),

/**
* The member was proposed by a consumer.
*/
PROPOSED (2, 2, "Proposed", "The member was proposed by a consumer."),

/**
* The member was imported from another system.
*/
IMPORTED (3, 3, "Imported", "The member was imported from another system."),

/**
* The member has been validated by a custodian/steward/approver and can be trusted.
*/
VALIDATED (4, 4, "Validated", "The member has been validated by a custodian/steward/approver and can be trusted."),

/**
* The membership has been deprecated. Consider stopping using it.
*/
DEPRECATED (5, 5, "Deprecated", "The membership has been deprecated. Consider stopping using it."),

/**
* The membership is obsolete and should not be used.
*/
OBSOLETE (6, 6, "Obsolete", "The membership is obsolete and should not be used."),

/**
* The membership has a different status not covered by the open metadata types.
*/
OTHER (99, 99, "Other", "The membership has a different status not covered by the open metadata types.");

private static final long serialVersionUID = 1L;

private static final String ENUM_TYPE_GUID = "a3bdb2ac-c28e-4e5a-8ab7-76aa01038832";
private static final String ENUM_TYPE_NAME = "MembershipStatus";

private final int openTypeOrdinal;

private final int ordinal;
private final String name;
private final String description;


/**
* Default constructor for the enumeration.
*
* @param ordinal numerical representation of the enumeration
* @param openTypeOrdinal code number from the equivalent Enum Type
* @param name default string name of the enumeration
* @param description default string description of the enumeration
*/
CollectionMemberStatus(int ordinal,
int openTypeOrdinal,
String name,
String description)
{
this.ordinal = ordinal;
this.openTypeOrdinal = openTypeOrdinal;
this.name = name;
this.description = description;
}


/**
* Return the numeric representation of the enumeration.
*
* @return int ordinal
*/
public int getOrdinal() { return ordinal; }


/**
* Return the default name of the enumeration.
*
* @return String name
*/
public String getName() { return name; }


/**
* Return the default description of the enumeration.
*
* @return String description
*/
public String getDescription() { return description; }


/**
* Return the code for this enum that comes from the Open Metadata Type that this enum represents.
*
* @return int code number
*/
public int getOpenTypeOrdinal()
{
return openTypeOrdinal;
}


/**
* Return the unique identifier for the open metadata enum type that this enum class represents.
*
* @return string guid
*/
public String getOpenTypeGUID() { return ENUM_TYPE_GUID; }


/**
* Return the unique name for the open metadata enum type that this enum class represents.
*
* @return string name
*/
public String getOpenTypeName() { return ENUM_TYPE_NAME; }


/**
* toString() JSON-style
*
* @return string description
*/
@Override
public String toString()
{
return "CollectionMemberStatus : " + name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,34 @@
@JsonIgnoreProperties(ignoreUnknown=true)
public enum CollectionOrder implements Serializable
{
/**
* Order the collection by the names of the members in the collection.
*/
NAME (0, 0, "Name", "Order the collection by the names of the members in the collection."),
OWNER (1, 1, "Owner", "Order the collection by the owners of the members in the collection (assets only)."),

/**
* Order the collection by the owners of the members in the collection.
*/
OWNER (1, 1, "Owner", "Order the collection by the owners of the members in the collection."),

/**
* Order the collection by the date that the members were added to the collection.
*/
DATE_ADDED (2, 2, "Date Added", "Order the collection by the date that the members were added to the collection."),

/**
* Order the collection by the date that the members were updated in the collection.
*/
DATE_UPDATED (3, 3, "Date Updated", "Order the collection by the date that the members were updated in the collection."),

/**
* Order the collection by the date that the members were created in the collection.
*/
DATE_CREATED (4, 4, "Date Created", "Order the collection by the date that the members were created in the collection."),

/**
* Order the collection by another value.
*/
OTHER (99, 99, "Other", "Order the collection by another value.");

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;

/**
* CollectionProperties describes the core properties of a collection.
* CollectionProperties describes the core properties of a collection. The collection is a managed list of elements.
*/
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -24,8 +24,9 @@
})
public class CollectionProperties extends ReferenceableProperties
{
private String name = null;
private String description = null;
private String name = null;
private String description = null;
private String collectionType = null;


/**
Expand All @@ -50,6 +51,7 @@ public CollectionProperties(CollectionProperties template)
{
this.name = template.getName();
this.description = template.getDescription();
this.collectionType = template.getCollectionType();
}
}

Expand Down Expand Up @@ -98,6 +100,28 @@ public void setDescription(String description)
}


/**
* Return a descriptive name for the collection's type.
*
* @return string name
*/
public String getCollectionType()
{
return collectionType;
}


/**
* Set up a descriptive name for the collection's type.
*
* @param collectionType string name
*/
public void setCollectionType(String collectionType)
{
this.collectionType = collectionType;
}


/**
* JSON-style toString
*
Expand All @@ -109,6 +133,7 @@ public String toString()
return "CollectionProperties{" +
"name='" + name + '\'' +
", description='" + description + '\'' +
", collectionType='" + collectionType + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", typeName='" + getTypeName() + '\'' +
Expand Down Expand Up @@ -139,7 +164,7 @@ public boolean equals(Object objectToCompare)
return false;
}
CollectionProperties that = (CollectionProperties) objectToCompare;
return Objects.equals(getName(), that.getName()) &&
return Objects.equals(getName(), that.getName()) && Objects.equals(getCollectionType(), that.getCollectionType()) &&
Objects.equals(getDescription(), that.getDescription());
}

Expand All @@ -152,6 +177,6 @@ public boolean equals(Object objectToCompare)
@Override
public int hashCode()
{
return Objects.hash(super.hashCode(), getName(), getDescription());
return Objects.hash(super.hashCode(), getName(), getDescription(), getCollectionType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,19 @@ public void setCollectionOrderingProperty(String collectionOrderingProperty)
public String toString()
{
return "CollectionFolderProperties{" +
"collectionOrderingProperty='" + collectionOrderingProperty + '\'' +
", collectionOrdering=" + collectionOrdering +
", name='" + getName() + '\'' +
", description='" + getDescription() + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", effectiveFrom=" + getEffectiveFrom() +
", effectiveTo=" + getEffectiveTo() +
", vendorProperties=" + getVendorProperties() +
", typeName='" + getTypeName() + '\'' +
", extendedProperties=" + getExtendedProperties() +
'}';
"collectionOrderingProperty='" + collectionOrderingProperty + '\'' +
", collectionOrdering=" + collectionOrdering +
", name='" + getName() + '\'' +
", description='" + getDescription() + '\'' +
", collectionType='" + getCollectionType() + '\'' +
", qualifiedName='" + getQualifiedName() + '\'' +
", additionalProperties=" + getAdditionalProperties() +
", effectiveFrom=" + getEffectiveFrom() +
", effectiveTo=" + getEffectiveTo() +
", vendorProperties=" + getVendorProperties() +
", typeName='" + getTypeName() + '\'' +
", extendedProperties=" + getExtendedProperties() +
'}';
}

/**
Expand Down
Loading

0 comments on commit 6b95f2f

Please sign in to comment.