public static class Segment.FieldValue
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.List<Segment.FieldValue> |
children
Sub-values of this FieldValue.
|
java.lang.String |
value
Scalar value of this FieldValue.
|
Constructor and Description |
---|
Segment.FieldValue()
Construct a null-value FieldValue
|
Segment.FieldValue(java.util.List<Segment.FieldValue> children)
Construct a composite FieldValue
|
Segment.FieldValue(java.lang.String value)
Construct a scalar FieldValue (no children)
|
Modifier and Type | Method and Description |
---|---|
static Segment.FieldValue |
composite(java.lang.Object... vals)
Create a composite FieldValue, whose children are passed as arguments.
|
static Segment.FieldValue |
copyOf(Segment.FieldValue v)
Returns a new FieldValue that is a deep copy of the given argument.
|
static Segment.FieldValue |
indexed(java.lang.Object... indexedVals)
Creates and returns a composite FieldValue whose children are specified by the
indexedVals argument as a sequence of index, value pairs. |
boolean |
isScalar()
Returns true if this is a scalar FieldValue, i.e.
|
static Segment.FieldValue |
scalar(java.lang.String value)
Create and return a scalar
FieldValue , whose String value is given as an argument. |
public java.lang.String value
public java.util.List<Segment.FieldValue> children
public Segment.FieldValue()
public Segment.FieldValue(java.lang.String value)
value
- textual value, or null.public Segment.FieldValue(java.util.List<Segment.FieldValue> children)
children
- (sub)components of the field valuepublic boolean isScalar()
public static Segment.FieldValue copyOf(Segment.FieldValue v)
public static Segment.FieldValue scalar(java.lang.String value)
FieldValue
, whose String value is given as an argument.public static Segment.FieldValue composite(java.lang.Object... vals)
vals
- String arguments will be converted to scalar FieldValue
S,
while FieldValue
arguments will be used as-is. All other types
will be converted to null-value FieldValue
S.public static Segment.FieldValue indexed(java.lang.Object... indexedVals)
indexedVals
argument as a sequence of index, value pairs. For instance,
FieldValue v = indexed(2, "Hello",
5, composite("Sub1", "Sub2"));
yields a composite FieldValue with five children: the second child being a scalar with value "Hello",
the fifth child a composite with two children (themselves scalars), and the first, third, and fourth
children having null values. A values may be given as a String, in which case it's wrapped into a
scalar FieldValue, or as a FieldValue, in which case it's used unchanged.
Segment.addFieldValue(int, com.illcode.hl7.Segment.FieldValue)
when
programmatically assembling HL7 messages.indexedVals
- index,value pairs