public class ObjectDefn extends Object
| Constructor and Description |
|---|
ObjectDefn(String name,
String typeValue,
List<ModelProperties.PropertyDefn<?>> fields) |
| Modifier and Type | Method and 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.
|
String |
name() |
Map<String,ModelProperties.PropertyDefn<?>> |
properties() |
ModelProperties.PropertyDefn<?> |
property(String key) |
protected static Map<String,ModelProperties.PropertyDefn<?>> |
toPropertyMap(List<ModelProperties.PropertyDefn<?>> props) |
String |
typeValue()
The type value is the value of the
"type" field written into the
object's Java or JSON representation. |
void |
validate(Map<String,Object> spec,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
Validate the property values using the property definitions defined in
this class.
|
public ObjectDefn(String name, String typeValue, List<ModelProperties.PropertyDefn<?>> fields)
protected static Map<String,ModelProperties.PropertyDefn<?>> toPropertyMap(List<ModelProperties.PropertyDefn<?>> props)
public String name()
public String typeValue()
"type" field written into the
object's Java or JSON representation. It is akin to the type used by
Jackson.public Map<String,ModelProperties.PropertyDefn<?>> properties()
public ModelProperties.PropertyDefn<?> property(String key)
public Map<String,Object> mergeProperties(Map<String,Object> source, Map<String,Object> update)
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.
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.