public static class VObjectPropertyValues.StructuredValueBuilder extends Object
Helper class for building "structured" property values.
Structured values are essentially 2-D arrays. They contain multiple components separated by semicolons, and each component can have multiple values separated by commas. The order that the components are in matters, but the order that each component's list of values are in usually doesn't matter.
Example:
StructuredValueBuilder b = new StructuredValueBuilder();
b.append("one").append(Arrays.asList("two", "three")).append("");
assertEquals("one;two,three;", b.build());
assertEquals("one;two,three", b.build(false));
| Constructor and Description |
|---|
StructuredValueBuilder() |
| Modifier and Type | Method and Description |
|---|---|
VObjectPropertyValues.StructuredValueBuilder |
append(List<?> component)
Appends a component.
|
VObjectPropertyValues.StructuredValueBuilder |
append(Object value)
Appends a single-valued component.
|
String |
build()
Builds the structured value string.
|
String |
build(boolean includeTrailingSemicolons)
Builds the structured value string.
|
public StructuredValueBuilder()
public VObjectPropertyValues.StructuredValueBuilder append(Object value)
toString()
method will be called to generate its string representation. If the
value is null, then an empty component will be appended.value - the valuepublic VObjectPropertyValues.StructuredValueBuilder append(List<?> component)
toString() method of each component
value will be called to generate its string representation. If a
value is null, then "null" will be outputted.component - the componentpublic String build()
Copyright © 2016–2018 Michael Angstadt. All rights reserved.