public final class DynamicStructureImpl extends java.lang.Object implements DynamicStructure, java.io.Serializable
DynamicStructure implementation backed by a StructValue.| Constructor and Description |
|---|
DynamicStructureImpl(StructValue strValue)
Constructor.
|
DynamicStructureImpl(StructValue strValue,
com.vmware.vapi.internal.bindings.TypeConverter converter)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Structure> |
_convertTo(java.lang.Class<T> clazz)
Converts this structure into an instance of the provided class structure
if possible.
|
java.lang.String |
_getCanonicalName()
Returns the canonical name of the structure.
|
StructValue |
_getDataValue()
Returns this
Structure represented in the dynamic
DataValue model. |
boolean |
_hasTypeNameOf(java.lang.Class<? extends Structure> clazz)
Checks if the runtime type name of this structure matches the type
represented by the specified binding class.
|
boolean |
equals(java.lang.Object other) |
<T> T |
getField(java.lang.String fieldName,
java.lang.Class<T> targetClass)
Gets a field value, represented as static bindings type.
|
int |
hashCode() |
<T> void |
setField(java.lang.String fieldName,
T newValue,
java.lang.Class<T> valueClass)
Sets a field value, represented as static bindings type.
|
java.lang.String |
toString() |
public DynamicStructureImpl(StructValue strValue)
strValue - the runtime struct value to be converted; must not be
nullpublic DynamicStructureImpl(StructValue strValue, com.vmware.vapi.internal.bindings.TypeConverter converter)
strValue - the runtime struct value to be converted; must not be
nullconverter - for conversion from/to native types; must not be
nullpublic StructValue _getDataValue()
StructureStructure represented in the dynamic
DataValue model.
Attempts to change the returned StructValue
representation are not required to change the state of this structure.
Actually the behavior is implementation dependent and is unspecified.
In general the returned value shouldn't be changed.
_getDataValue in interface StructureStructValue representing this structurepublic <T> T getField(java.lang.String fieldName,
java.lang.Class<T> targetClass)
DynamicStructuregetField in interface DynamicStructureT - static binding type for the field valuefieldName - name of the field to gettargetClass - Class for the result field valuepublic <T> void setField(java.lang.String fieldName,
T newValue,
java.lang.Class<T> valueClass)
DynamicStructuresetField in interface DynamicStructureT - static binding type for the field valuefieldName - name of the field to setnewValue - new value for fieldName fieldvalueClass - Class of newValuepublic boolean _hasTypeNameOf(java.lang.Class<? extends Structure> clazz)
StructureThis can be used as efficient check to determine if this instance
can be successfully converted to the target
type.
_hasTypeNameOf in interface Structureclazz - bindings class for the target structure; must not be nullpublic <T extends Structure> T _convertTo(java.lang.Class<T> clazz)
Structure_convertTo in interface Structureclazz - type of the result structure. cannot be null.CoreException is thrown otherwise.public java.lang.String _getCanonicalName()
Structureorg.example.FooBar would turn into
org.example.foo_bar._getCanonicalName in interface Structurepublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object