public interface MString extends MField
This defines a field
that is represented as a variable length
string of characters. In the simplest case this can contain any unicode
characters but subtypes may imply some special meaning and therefore
constraints upon the field content.
The field will be represented internally as a String
and its byte
representation will be whatever is appropriate for encoding of unicode
Strings for transport.
It is possible to parse the value of an item of this type from any object as
the toString
method will be used.
The easiest way to create a string metadata field is using
MetadataFactory.string(String)
or one of its variants that allow an
initial value to be supplied. For example:
MetadataFactory factory = Diffusion.metadata();
MString aString = factory.string("A","---");
Alternatively for more complex requirements a MString.Builder
may be used.Modifier and Type | Interface and Description |
---|---|
static interface |
MString.AbstractBuilder<T,B>
Abstract string field metadata builder.
|
static interface |
MString.Builder
String metadata field builder.
|
MField.FieldType
MNode.DataType, MNode.Multiplicity, MNode.NodeType
Modifier and Type | Method and Description |
---|---|
boolean |
allowsEmpty()
Indicates whether the field allows an empty value when parsed from String
input.
|
String |
getDefaultValue()
Returns the default value that required occurrences of the field should
be initialized to.
|
getFieldType
getDataType, getFullName, getMultiplicity, getName, getNodeType, getParent
String getDefaultValue()
boolean allowsEmpty()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.