Package org.epics.pvdata.pv
Interface Union
-
- All Superinterfaces:
Field,Serializable
- All Known Implementing Classes:
BaseUnion
public interface Union extends Field
Reflection interface for an union field.- Author:
- mse
-
-
Field Summary
Fields Modifier and Type Field Description static StringANY_IDDefault variant union ID.static StringDEFAULT_IDDefault union ID.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FieldgetField(int fieldIndex)Get a sub fields by index.<T extends Field>
TgetField(Class<T> c, int fieldIndex)Get a subfield by index.<T extends Field>
TgetField(Class<T> c, String fieldName)Get the Field for the specified fieldNameFieldgetField(String fieldName)Get the Field for the specified fieldNameintgetFieldIndex(String fieldName)Get the index of the specified field.StringgetFieldName(int fieldIndex)Get the name of the subfield by index.String[]getFieldNames()Get the array of the subfield namesField[]getFields()Get a list of union fields (members).booleanisVariant()Check if this union is variant union (aka any type).-
Methods inherited from interface org.epics.pvdata.pv.Field
getID, getType, toString, toString, toString
-
Methods inherited from interface org.epics.pvdata.pv.Serializable
deserialize, serialize
-
-
-
-
Field Detail
-
DEFAULT_ID
static final String DEFAULT_ID
Default union ID.- See Also:
- Constant Field Values
-
ANY_ID
static final String ANY_ID
Default variant union ID.- See Also:
- Constant Field Values
-
-
Method Detail
-
getField
Field getField(String fieldName)
Get the Field for the specified fieldName- Parameters:
fieldName- the name of the field- Returns:
- the Field that describes the field
-
getFieldIndex
int getFieldIndex(String fieldName)
Get the index of the specified field.- Parameters:
fieldName- the name of the field- Returns:
- the index or -1 if fieldName is not a field in the union
-
getFields
Field[] getFields()
Get a list of union fields (members).- Returns:
- an array of fields (can be empty), non-
null
-
getField
Field getField(int fieldIndex)
Get a sub fields by index.- Parameters:
fieldIndex- the field index- Returns:
- the field at specified index
-
getField
<T extends Field> T getField(Class<T> c, String fieldName)
Get the Field for the specified fieldName- Type Parameters:
T- the expected type of the Field of the requested field- Parameters:
c- class object modeling the class T of expected type of the requested fieldfieldName- the fieldName- Returns:
- the Field or null if the field does not exist, or the field is not of
ctype
-
getField
<T extends Field> T getField(Class<T> c, int fieldIndex)
Get a subfield by index.- Type Parameters:
T- the expected type of the Field of the requested field- Parameters:
c- class object modeling the class T of expected type of the requested fieldfieldIndex- the index- Returns:
- the Field or null if the index is invalid, or the field is not of
ctype
-
getFieldNames
String[] getFieldNames()
Get the array of the subfield names- Returns:
- the array of the subfield names
-
getFieldName
String getFieldName(int fieldIndex)
Get the name of the subfield by index.- Parameters:
fieldIndex- the field index- Returns:
- the name of the field
-
isVariant
boolean isVariant()
Check if this union is variant union (aka any type).- Returns:
trueif this union is variant union, otherwisefalse
-
-