Class ValueDescriptorNode<Value, Builder extends IValueBuilder<Value>>
java.lang.Object
de.xima.fc.interfaces.workflow.value.ValueDescriptorNode<Value,Builder>
- Direct Known Subclasses:
ValueDescriptorNode.ListItem, ValueDescriptorNode.MapValue, ValueDescriptorNode.RecordKey, ValueDescriptorNode.Root, ValueDescriptorNode.TupleIndex, ValueDescriptorNode.UnionMember
public abstract class ValueDescriptorNode<Value, Builder extends IValueBuilder<Value>>
extends Object
Wrapper to treat
value descriptors as nodes in a tree structure. Container value descriptors
(like unions, lists, maps, tuples, and records) have children corresponding to their contained value descriptors,
while primitive value descriptors have no children. Adds separate nodes for the keys of record members and the
indices of tuple elements.- Since:
- 8.5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classNode representing the list item value descriptor of a list value descriptor.static final classNode representing the map value descriptor of a map value descriptor.static final classNode representing a record member at a certain key in a record value descriptor.static final classValueDescriptorNode.Root<Value, Builder extends IValueBuilder<Value>>Node representing the root of the value descriptor tree.static final classNode representing a tuple element at a certain index in a tuple value descriptor.static final class -
Method Summary
Modifier and TypeMethodDescriptionabstract IValueDescriptor<Value, Builder> Gets the container value descriptor representing the container of the element.abstract IValueDescriptor<?, ?> element()Gets the value descriptor of the element in the container.abstract Iterable<? extends ValueDescriptorNode<?, ?>> Gets the children of this node in the tree structure.static <V> ValueDescriptorNode.ListItem<V> list(IListValueDescriptor<V> list) Wraps a list value descriptor into aValueDescriptorNode.ListItemnode.static <V> ValueDescriptorNode.MapValue<V> map(IMapValueDescriptor<V> map) Wraps a map value descriptor into aValueDescriptorNode.MapValuenode.record(IRecordValueDescriptor descriptor, String key) Wraps a record member of a record value descriptor at a given key into aValueDescriptorNode.RecordKeynode.static <Value, Builder extends IValueBuilder<Value>>
ValueDescriptorNode.Root<Value, Builder> root(IValueDescriptor<Value, Builder> descriptor) Wraps a value descriptor into aValueDescriptorNode.Rootnode.tuple(ITupleValueDescriptor descriptor, int index) Wraps a tuple element of a tuple value descriptor at a given index into aValueDescriptorNode.TupleIndexnode.union(IUnionValueDescriptor descriptor, int index) Wraps a member of union value descriptor at a given index into aValueDescriptorNode.UnionMembernode.
-
Method Details
-
container
Gets the container value descriptor representing the container of the element.- Returns:
- The container value descriptor.
-
element
Gets the value descriptor of the element in the container.- Returns:
- The value descriptor.
-
getChildren
Gets the children of this node in the tree structure.- Returns:
- An iterable of child nodes.
-
list
Wraps a list value descriptor into aValueDescriptorNode.ListItemnode.- Type Parameters:
V- The type of the list items.- Parameters:
list- The list value descriptor to wrap.- Returns:
- The corresponding list item node.
-
map
Wraps a map value descriptor into aValueDescriptorNode.MapValuenode.- Type Parameters:
V- The type of the map values.- Parameters:
map- The map value descriptor to wrap.- Returns:
- The corresponding map value node.
-
record
Wraps a record member of a record value descriptor at a given key into aValueDescriptorNode.RecordKeynode.- Parameters:
descriptor- The record value descriptor to wrap.key- The key of the record member to wrap.- Returns:
- The corresponding record key node.
-
root
public static <Value, Builder extends IValueBuilder<Value>> ValueDescriptorNode.Root<Value,Builder> root(IValueDescriptor<Value, Builder> descriptor) Wraps a value descriptor into aValueDescriptorNode.Rootnode.- Type Parameters:
Value- The type of the value.Builder- The type of the value builder.- Parameters:
descriptor- The value descriptor to wrap.- Returns:
- The corresponding root node.
-
tuple
Wraps a tuple element of a tuple value descriptor at a given index into aValueDescriptorNode.TupleIndexnode.- Parameters:
descriptor- The tuple value descriptor to wrap.index- The index of the tuple element to wrap.- Returns:
- The corresponding tuple index node.
-
union
Wraps a member of union value descriptor at a given index into aValueDescriptorNode.UnionMembernode.- Parameters:
descriptor- The union value descriptor to wrap.index- The index of the union member to wrap.- Returns:
- The corresponding union member node.
-