public static final class MessageType.MessageField extends Object
This class is immutable.
| Constructor and Description |
|---|
MessageField(int index,
String name,
MethodHandle field,
DataType eType,
String charset,
boolean optFlag)
Stores the layout field attributes.
|
| Modifier and Type | Method and Description |
|---|---|
String |
charset()
Returns the associated character set used to serialize
a text field if this field is of
StringType. |
DataType |
dataType()
Returns the eBus data type.
|
boolean |
equals(Object o)
Returns
true if o is a
non-null MessageType.Field with the same index
as this field. |
MethodHandle |
field()
Returns the Java class field.
|
int |
hashCode()
Returns the field index as the hash code.
|
int |
index()
Returns the field index.
|
boolean |
isArray()
Returns
true if this is an array field and
false otherwise. |
boolean |
isOptional()
Returns
true if this field is option and,
therefore, may be set to null. |
Class<?> |
javaType()
Returns the Java class associated with this field.
|
String |
name()
Returns the field name.
|
MethodHandle |
setter()
Returns the message builder class setter method for
this field.
|
String |
toString()
Returns the string representation of this message
field.
|
public MessageField(int index,
String name,
MethodHandle field,
DataType eType,
String charset,
boolean optFlag)
index - field index (≥ zero)name - the field name.field - the message field.eType - eBus field data type.charset - name of java.nio.charset.Charset
class.optFlag - true if field may be set to
null.public boolean equals(Object o)
true if o is a
non-null MessageType.Field with the same index
as this field.public int hashCode()
public String toString()
public int index()
public String name()
public MethodHandle field()
public Class<?> javaType()
public DataType dataType()
public boolean isArray()
true if this is an array field and
false otherwise.true if this is an array field and
false otherwise.public String charset()
StringType.
Otherwise returns null.null otherwise.public boolean isOptional()
true if this field is option and,
therefore, may be set to null.true if field is optional.public MethodHandle setter()
Copyright © 2019. All rights reserved.