| Modifier and Type | Class and Description |
|---|---|
static class |
StructType.FieldNameDetails
Field name details structure.
|
| Constructor and Description |
|---|
StructType(String name,
Map<String,Type> fields,
Class<?> bindingClass,
List<com.vmware.vapi.internal.data.ConstraintValidator> validators,
boolean isModel,
List<String> modelKeyFields,
Map<String,StructType.FieldNameDetails> fieldNameDetails)
Constructor overload for compatibility with bindings generated with
older version of vAPI generator.
|
StructType(String name,
Map<String,Type> fields,
Class<?> bindingClass,
List<com.vmware.vapi.internal.data.ConstraintValidator> validators,
boolean isModel,
List<String> modelKeyFields,
Map<String,StructType.FieldNameDetails> fieldNameDetails,
String discriminator,
String discriminatedBy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(TypeVisitor visitor)
Accepts a type visitor and dispatches to the appropriate visitor method,
depending on class of the individual type.
|
Class<?> |
getBindingClass()
Returns a class which represents the Java language binding of this
structure.
|
String |
getDiscriminatedBy()
Returns the value which identifies this structure when used in a
discriminator field.
|
String |
getDiscriminator()
Returns the name of the field in this structure which serves as
type discriminator.
|
Type |
getField(String field)
Returns the type of the specified structure field.
|
Type |
getFieldByJavaName(String javaName)
Returns the type of the specified structure field by its mixed case
(java) name.
|
StructType.FieldNameDetails |
getFieldNameDetails(String canonicalName)
Get field name details by the field canonical name.
|
Set<String> |
getFieldNames()
Returns the names of the structure fields in no particular order.
|
Iterable<String> |
getFieldWithSetterNames()
Returns the names of the structure fields, which do have setters, in no
particular order.
|
Method |
getGetterMethodForField(String fieldName)
Get the
Method representing the getter for the specified field in the
the binding class for the structure. |
List<String> |
getModelKeyFields()
Get array specifying model key fields names for the model.
|
String |
getName()
Returns the name of the structure.
|
Method |
getSetterMethodForField(String fieldName)
Get the
Method representing the setter for the specified field in the
the binding class for the structure. |
boolean |
isModel()
Check if the structure is marked as model.
|
void |
validate(StructValue structValue)
Enforces all static (defined in the IDL) or dynamic constrains defined
over this structure.
|
void |
validate(StructValue structValue,
MethodIdentifier methodId)
Enforces all static (defined in the IDL) or dynamic constrains defined
over this structure.
|
public StructType(String name, Map<String,Type> fields, Class<?> bindingClass, List<com.vmware.vapi.internal.data.ConstraintValidator> validators, boolean isModel, List<String> modelKeyFields, Map<String,StructType.FieldNameDetails> fieldNameDetails)
public StructType(String name, Map<String,Type> fields, Class<?> bindingClass, List<com.vmware.vapi.internal.data.ConstraintValidator> validators, boolean isModel, List<String> modelKeyFields, Map<String,StructType.FieldNameDetails> fieldNameDetails, String discriminator, String discriminatedBy)
name - name of the structurefields - types of the structure fieldsbindingClass - Java language binding of the structure typevalidators - validators for constraints defined for in this
StructType; may be nullisModel - true iff the structure is marked as modelmodelKeyFields - list of the model primary key fieldsfieldNameDetails - map of field name details, the key is the field
canonical name, the value is instance of the StructType.FieldNameDetailsdiscriminator - name of a field which serves as discriminator; may
be null when no discriminator is present; if not null
field with such name must be present in fields map;discriminatedBy - value identifying this structure when used in a
discriminator field; may be null if no such value is present;
if not null, the discriminator must not be null
as wellIllegalArgumentException - if some pre-condition for this method
(described per above) is violatedpublic String getName()
public String getDiscriminator()
null if such is not presentpublic String getDiscriminatedBy()
null if such is
not availablegetDiscriminator()public Set<String> getFieldNames()
public Iterable<String> getFieldWithSetterNames()
public Type getField(String field)
field - canonical name of a structure field; must not be nullpublic Type getFieldByJavaName(String javaName)
javaName - mixed case name of a structure field; must not be nullpublic List<String> getModelKeyFields()
public Method getGetterMethodForField(String fieldName)
Method representing the getter for the specified field in the
the binding class for the structure.fieldName - name of the field; must not be nullConverterException - if no method is available for the specified field namepublic Method getSetterMethodForField(String fieldName)
Method representing the setter for the specified field in the
the binding class for the structure.fieldName - name of the field; must not be nullConverterException - if no method is available for the specified field namepublic void validate(StructValue structValue)
structValue - struct value to validate; cannot be nullConstraintValidationException - if the constraint is not satisfiedpublic void validate(StructValue structValue, MethodIdentifier methodId)
structValue - struct value to validate; must not be nullmethodId - the method invocation in which context the dataValue was
passed (as a parameter). must not be nullConstraintValidationException - if the constraint is not satisfiedpublic Class<?> getBindingClass()
public boolean isModel()
public void accept(TypeVisitor visitor)
Typepublic StructType.FieldNameDetails getFieldNameDetails(String canonicalName)
canonicalName - the field canonical name; must not be null.null if no details are availableCopyright © 2023. All rights reserved.