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 Details

  • Method Details

    • 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 is null, 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.

    • validate

      public void validate(Map<String,Object> spec, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
      Validate the property values using the property definitions defined in this class. The list may contain "custom" properties which are accepted as-is.