Package org.apache.druid.catalog.model
Class ObjectDefn
- java.lang.Object
-
- org.apache.druid.catalog.model.ObjectDefn
-
- Direct Known Subclasses:
TableDefn
public class ObjectDefn extends Object
Metadata definition of the metadata objects stored in the catalog. (Yes, that means that this is meta-meta-data.) Objects consist of a map of property values (and perhaps other items defined in subclasses.) Each property is defined by a column metadata object. Objects allow extended properties which have no definition: the meaning of such properties is defined elsewhere.
-
-
Constructor Summary
Constructors Constructor Description ObjectDefn(String name, String typeValue, List<ModelProperties.PropertyDefn<?>> fields)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>mergeProperties(Map<String,Object> source, Map<String,Object> update)Merge the properties for an object using a set of updates in a map.Stringname()Map<String,ModelProperties.PropertyDefn<?>>properties()ModelProperties.PropertyDefn<?>property(String key)protected static Map<String,ModelProperties.PropertyDefn<?>>toPropertyMap(List<ModelProperties.PropertyDefn<?>> props)StringtypeValue()The type value is the value of the"type"field written into the object's Java or JSON representation.voidvalidate(Map<String,Object> spec, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)Validate the property values using the property definitions defined in this class.
-
-
-
Constructor Detail
-
ObjectDefn
public ObjectDefn(String name, String typeValue, List<ModelProperties.PropertyDefn<?>> fields)
-
-
Method Detail
-
toPropertyMap
protected static Map<String,ModelProperties.PropertyDefn<?>> toPropertyMap(List<ModelProperties.PropertyDefn<?>> props)
-
name
public String name()
-
typeValue
public String typeValue()
The type value is the value of the"type"field written into the object's Java or JSON representation. It is akin to the type used by Jackson.
-
properties
public Map<String,ModelProperties.PropertyDefn<?>> properties()
-
property
public ModelProperties.PropertyDefn<?> property(String key)
-
mergeProperties
public Map<String,Object> mergeProperties(Map<String,Object> source, Map<String,Object> update)
Merge the properties for an object using a set of updates in a map. If the update value isnull, then remove the property in the revised set. If the property is known, use the column definition to merge the values. Else, the update replaces any existing value.This method does not validate the properties, except as needed to do a merge. A separate validation step is done on the final, merged object.
-
-