public class StructDefinition extends DataDefinition
| Constructor and Description |
|---|
StructDefinition(String name,
Map<String,DataDefinition> fields)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(DefinitionVisitor visitor)
Applies a visitor to this data-definition.
|
void |
completeValue(DataValue value)
Check the value to see if the data-definition can fill in any missing
data before validation
|
boolean |
equals(Object other) |
DataDefinition |
getField(String field) |
Set<String> |
getFieldNames() |
String |
getName() |
DataType |
getType()
Returns the
DataType for this type. |
boolean |
hasField(String field) |
int |
hashCode() |
StructValue |
newInstance() |
String |
toString() |
List<Message> |
validate(DataValue value)
Validates that the specified
DataValue is an instance of this
data definition. |
validInstanceOfpublic StructDefinition(String name, Map<String,DataDefinition> fields)
name - name for the structure; must not be nullfields - field names and definitions for the structure;
must not be nullIllegalArgumentException - if some of the arguments or the
values in fields is nullpublic DataType getType()
DataDefinitionDataType for this type.getType in class DataDefinitionDataType for this typepublic String getName()
public DataDefinition getField(String field)
public boolean hasField(String field)
public StructValue newInstance()
public List<Message> validate(DataValue value)
DataValue is an instance of this
data definition.
Validates that supplied value is not null
and it's type matches the type of this definition.
In addition, validates that value's name matches
this definition name and value's fields
are valid for this definition fields.
validate in class DataDefinitionvalue - the DataValue to validatepublic void completeValue(DataValue value)
DataDefinitioncompleteValue in class DataDefinitionvalue - the value to checkpublic String toString()
DataDefinitiontoString in class DataDefinitionpublic void accept(DefinitionVisitor visitor)
DataDefinitionaccept in class DataDefinitionvisitor - the visitor operating on this data-definitionCopyright © 2023. All rights reserved.