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 treatvalue descriptorsas 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 Classes Modifier and Type Class Description static classValueDescriptorNode.ListItem<V>Node representing the list item value descriptor of a list value descriptor.static classValueDescriptorNode.MapValue<V>Node representing the map value descriptor of a map value descriptor.static classValueDescriptorNode.RecordKeyNode representing a record member at a certain key in a record value descriptor.static classValueDescriptorNode.Root<Value,Builder extends IValueBuilder<Value>>Node representing the root of the value descriptor tree.static classValueDescriptorNode.TupleIndexNode representing a tuple element at a certain index in a tuple value descriptor.static classValueDescriptorNode.UnionMember
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IValueDescriptor<Value,Builder>container()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<?,?>>getChildren()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.static ValueDescriptorNode.RecordKeyrecord(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.static ValueDescriptorNode.TupleIndextuple(ITupleValueDescriptor descriptor, int index)Wraps a tuple element of a tuple value descriptor at a given index into aValueDescriptorNode.TupleIndexnode.static ValueDescriptorNode.UnionMemberunion(IUnionValueDescriptor descriptor, int index)Wraps a member of union value descriptor at a given index into aValueDescriptorNode.UnionMembernode.
-
-
-
Method Detail
-
container
public abstract IValueDescriptor<Value,Builder> container()
Gets the container value descriptor representing the container of the element.- Returns:
- The container value descriptor.
-
element
public abstract IValueDescriptor<?,?> element()
Gets the value descriptor of the element in the container.- Returns:
- The value descriptor.
-
getChildren
public abstract Iterable<? extends ValueDescriptorNode<?,?>> getChildren()
Gets the children of this node in the tree structure.- Returns:
- An iterable of child nodes.
-
list
public static <V> ValueDescriptorNode.ListItem<V> list(IListValueDescriptor<V> 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
public static <V> ValueDescriptorNode.MapValue<V> map(IMapValueDescriptor<V> 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
public static ValueDescriptorNode.RecordKey record(IRecordValueDescriptor descriptor, String key)
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
public static ValueDescriptorNode.TupleIndex tuple(ITupleValueDescriptor descriptor, int index)
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
public static ValueDescriptorNode.UnionMember union(IUnionValueDescriptor descriptor, int index)
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.
-
-