Package org.openmetadata.service.util
Class EntityUtil
java.lang.Object
org.openmetadata.service.util.EntityUtil
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BiPredicate<Column,Column> static final BiPredicate<Column,Column> static final Comparator<ChangeEvent>static final Comparator<CustomProperty>static final Comparator<EntityReference>static final Comparator<EntityReference>static final Comparator<FieldChange>static final Comparator<GlossaryTerm>static final Comparator<TableConstraint>static final Comparator<TagLabel>static final Comparator<CollectionDAO.EntityVersionPair>static final BiPredicate<ContainerFileFormat,ContainerFileFormat> static final BiPredicate<CustomProperty,CustomProperty> static final BiPredicate<EntityReference,EntityReference> static final BiPredicate<GlossaryTerm,GlossaryTerm> static final BiPredicate<MlFeature,MlFeature> static final BiPredicate<MlHyperParameter,MlHyperParameter> static final BiPredicate<Object,Object> static final BiPredicate<Rule,Rule> static final BiPredicate<Field,Field> static final BiPredicate<SearchIndexField,SearchIndexField> static final BiPredicate<String,String> static final BiPredicate<TableConstraint,TableConstraint> static final BiPredicate<TagLabel,TagLabel> static final BiPredicate<Task,Task> static final BiPredicate<TermReference,TermReference> -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic voidcopy(EntityReference from, EntityReference to) static MetadataOperationcreateOrUpdateOperation(ResourceContext<?> resourceContext) static voidfieldAdded(ChangeDescription change, String fieldName, Object newValue) static voidfieldDeleted(ChangeDescription change, String fieldName, Object oldValue) static voidfieldUpdated(ChangeDescription change, String fieldName, Object oldValue, Object newValue) static ColumnfindColumn(List<Column> columns, String columnName) static Columnstatic StringgetColumnField(Column column, String columnField) Return column field name of format "columns".columnName.columnFieldNamestatic StringgetCustomField(CustomProperty property, String propertyFieldName) Return customer property field name of format "customProperties".propertyNamestatic EntityReferencegetEntityReference(String entityType, String fqn) static EntityReferencegetEntityReference(EntityInterface entity) static List<EntityReference>getEntityReferences(String entityType, List<String> fqns) static List<EntityReference>getEntityReferences(List<EntityReference> entities, Include include) This method is used to populate the entity with all details of EntityReference Users/Tools can send minimum details required to set relationship as id, type are the only required fields in entity reference, whereas we need to send fully populated object such that ElasticSearch index has all the details.static List<EntityReference>static StringgetExtensionField(String key) Return extension field name of format "extension".fieldNamestatic StringgetFieldName(String... strings) static <T extends FieldInterface>
List<T>getFlattenedEntityField(List<T> fields) static StringgetFqn(EntityInterface entity) static StringgetFqn(EntityReference ref) getFqns(List<EntityReference> refs) static UUIDgetId(EntityReference ref) getJsonDataResources(String path) static UsageDetailsgetLatestUsage(CollectionDAO.UsageDAO usageDAO, UUID entityId) static StringgetLocalColumnName(String tableFqn, String columnFqn) static StringgetRuleField(Rule rule, String ruleField) Return rule field name of format "rules".ruleName.ruleFieldNamestatic StringgetSchemaField(Topic topic, Field field, String fieldName) Return schema field name of format "schemaFields".fieldName.fieldNamestatic StringgetSearchIndexField(SearchIndex searchIndex, SearchIndexField field, String fieldName) Return searchIndex field name of format "fields".fieldName.fieldNamestatic DoublegetVersion(String extension) static StringgetVersionExtension(String entityType, Double version) Entity version extension name formed by entityType.version.versionNumber.static StringgetVersionExtensionPrefix(String entityType) Entity version extension name prefix formed by `entityType.version`.static Stringstatic booleanisApprovalTask(TaskType taskType) static <T> booleanisDescriptionRequired(Class<T> clz) static booleanisDescriptionTask(TaskType taskType) static booleanstatic booleanisTestCaseFailureResolutionTask(TaskType taskType) static voidMerge two sets of tagsstatic DoublenextMajorVersion(Double version) static DoublenextVersion(Double version) static List<EntityReference>static List<EntityReference>populateEntityReferencesById(List<UUID> list, String entityType) static DoublepreviousVersion(Double version) refToIds(List<EntityReference> refs) static voidsortByFQN(List<? extends EntityInterface> entities) static List<EntityReference>toEntityReferences(List<UUID> ids, String entityType) static <T extends EntityInterface>
List<String>static TagLabeltoTagLabel(Tag tag) static TagLabeltoTagLabel(GlossaryTerm term) toTagLabels(Tag... tags) toTagLabels(GlossaryTerm... terms) static <T> TValidate that JSON payload can be turned into POJO objectstatic EntityReferencevalidateEntityLink(MessageParser.EntityLink entityLink) static voidvalidateProfileSample(String profileSampleType, double profileSampleValue)
-
Field Details
-
compareEntityReference
-
compareEntityReferenceById
-
compareVersion
-
compareTagLabel
-
compareFieldChange
-
compareTableConstraint
-
compareChangeEvent
-
compareGlossaryTerm
-
compareCustomProperty
-
objectMatch
-
entityReferenceMatch
-
tagLabelMatch
-
taskMatch
-
stringMatch
-
columnMatch
-
columnNameMatch
-
tableConstraintMatch
-
mlFeatureMatch
-
mlHyperParameterMatch
-
glossaryTermMatch
-
containerFileFormatMatch
-
termReferenceMatch
-
customFieldMatch
-
ruleMatch
-
schemaFieldMatch
-
searchIndexFieldMatch
-
-
Method Details
-
validate
public static <T> T validate(Object id, String json, Class<T> clz) throws javax.ws.rs.WebApplicationException Validate that JSON payload can be turned into POJO object- Throws:
javax.ws.rs.WebApplicationException
-
populateEntityReferences
-
getEntityReferences
public static List<EntityReference> getEntityReferences(List<CollectionDAO.EntityRelationshipRecord> list) -
populateEntityReferencesById
public static List<EntityReference> populateEntityReferencesById(List<UUID> list, String entityType) -
validateEntityLink
-
getLatestUsage
-
mergeTags
Merge two sets of tags -
getJsonDataResources
- Throws:
IOException
-
toFQNs
-
strToIds
-
toEntityReferences
-
refToIds
-
isDescriptionRequired
-
getVersionExtension
Entity version extension name formed by entityType.version.versionNumber. Example - `table.version.0.1` -
getVersionExtensionPrefix
Entity version extension name prefix formed by `entityType.version`. Example - `table.version` -
getVersion
-
getLocalColumnName
-
getFieldName
-
getColumnField
Return column field name of format "columns".columnName.columnFieldName -
getSchemaField
Return schema field name of format "schemaFields".fieldName.fieldName -
getSearchIndexField
public static String getSearchIndexField(SearchIndex searchIndex, SearchIndexField field, String fieldName) Return searchIndex field name of format "fields".fieldName.fieldName -
getRuleField
Return rule field name of format "rules".ruleName.ruleFieldName -
getCustomField
Return customer property field name of format "customProperties".propertyName -
getExtensionField
Return extension field name of format "extension".fieldName -
previousVersion
-
nextVersion
-
nextMajorVersion
-
copy
-
toTagLabels
-
toTagLabels
-
toTagLabel
-
toTagLabel
-
addField
-
fieldAdded
-
fieldDeleted
-
fieldUpdated
public static void fieldUpdated(ChangeDescription change, String fieldName, Object oldValue, Object newValue) -
createOrUpdateOperation
-
getId
-
getFqn
-
getFqn
-
getFqns
-
getEntityReference
-
getEntityReference
-
getEntityReferences
-
getColumn
-
sortByFQN
-
getEntityReferences
public static List<EntityReference> getEntityReferences(List<EntityReference> entities, Include include) This method is used to populate the entity with all details of EntityReference Users/Tools can send minimum details required to set relationship as id, type are the only required fields in entity reference, whereas we need to send fully populated object such that ElasticSearch index has all the details. -
validateProfileSample
-
hash
-
isDescriptionTask
-
isTagTask
-
isApprovalTask
-
isTestCaseFailureResolutionTask
-
findColumn
-
getFlattenedEntityField
-