Class ValueDescriptorFactory
- java.lang.Object
-
- de.xima.fc.workflow.processor.value.ValueDescriptorFactory
-
- All Implemented Interfaces:
IValueDescriptorFactory
,Serializable
@Immutable public final class ValueDescriptorFactory extends Object implements IValueDescriptorFactory, Serializable
Default implementation of theIValueDescriptorFactory
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValueDescriptorFactory()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.workflow.value.IValueDescriptorFactory
any, bool, bool, bool, constant, constant, constant, constant, floating, floating, floating, integer, integer, integer, largeString, largeString, largeString, list, list, listOfLargeStrings, listOfLargeStrings, listOfStrings, listOfStrings, map, map, mapToLargeStrings, mapToLargeStrings, mapToStrings, mapToStrings, nullish, nullish, string, string, string, tuple, tuple, tupleOfSame, tupleOfSame, unionEmpty, unionEnumBuilder, unionOfEnumConst, unionOfEnumConst, unionOfEnumConstBuilder, unionOfEnumConstBuilder, unionOfStringConst, unionOfStringConst, unionOfStringConst, unionOfStringConstBuilder, unionOfStringConstBuilder, unionOfStringConstBuilder, unionStringBuilder
-
-
-
-
Method Detail
-
accessAtPath
public List<?> accessAtPath(Object base, String path)
Description copied from interface:IValueDescriptorFactory
Access a nested property in an object at a given JSON path.- Specified by:
accessAtPath
in interfaceIValueDescriptorFactory
- Parameters:
base
- Base object with data to access.path
- JSON path to the data to access.- Returns:
- The data at the given path in the base object.
-
anyBuilder
public IAnyValueDescriptorBuilder anyBuilder()
- Specified by:
anyBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for an any value.
-
boolBuilder
public IBooleanValueDescriptorBuilder boolBuilder()
- Specified by:
boolBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a boolean value.
-
constantBuilder
public IConstValueDescriptorBuilder<Boolean> constantBuilder(boolean value)
- Specified by:
constantBuilder
in interfaceIValueDescriptorFactory
- Parameters:
value
- The constant value that the descriptor should allow.- Returns:
- A descriptor builder for a boolean value that only admits a constant instance.
-
constantBuilder
public IConstValueDescriptorBuilder<Double> constantBuilder(double value)
- Specified by:
constantBuilder
in interfaceIValueDescriptorFactory
- Parameters:
value
- The constant value that the descriptor should allow.- Returns:
- A descriptor builder for a floating point value that only admits a constant instance.
-
constantBuilder
public IConstValueDescriptorBuilder<Long> constantBuilder(long value)
- Specified by:
constantBuilder
in interfaceIValueDescriptorFactory
- Parameters:
value
- The constant value that the descriptor should allow.- Returns:
- A descriptor builder for an integer value that only admits a constant instance.
-
constantBuilder
public IConstValueDescriptorBuilder<String> constantBuilder(String value)
- Specified by:
constantBuilder
in interfaceIValueDescriptorFactory
- Parameters:
value
- The constant value that the descriptor should allow.- Returns:
- A descriptor builder for a string value that only admits a constant instance.
-
floatingBuilder
public IFloatValueDescriptorBuilder floatingBuilder()
- Specified by:
floatingBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a floating point value.
-
integerBuilder
public IIntegerValueDescriptorBuilder integerBuilder()
- Specified by:
integerBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for an integer value.
-
largeStringBuilder
public ILargeStringValueDescriptorBuilder largeStringBuilder()
- Specified by:
largeStringBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a large string value.
-
listBuilder
public <V> IListValueDescriptorBuilder<V> listBuilder(IValueDescriptor<V,? extends IValueBuilder<V>> descriptor)
- Specified by:
listBuilder
in interfaceIValueDescriptorFactory
- Type Parameters:
V
- Type of the elements contained in the list.- Parameters:
descriptor
- Descriptor for the elements contained in the list.- Returns:
- A descriptor builder for a list value (
List<V>
).
-
listBuilder
public <V> IListValueDescriptorBuilder<V> listBuilder(IValueDescriptorCreator<V> elementType)
- Specified by:
listBuilder
in interfaceIValueDescriptorFactory
- Type Parameters:
V
- Type of the elements contained in the list.- Parameters:
elementType
- Creates the descriptor for the type of the list elements.- Returns:
- A descriptor builder for a list value (
List<V>
).
-
mapBuilder
public <V> IMapValueDescriptorBuilder<V> mapBuilder(IValueDescriptor<V,? extends IValueBuilder<V>> descriptor)
- Specified by:
mapBuilder
in interfaceIValueDescriptorFactory
- Type Parameters:
V
- Type of the mapped values.- Parameters:
descriptor
- Descriptor for the type of the mapped values.- Returns:
- A descriptor builder for a map value (
Map<String, V>
).
-
mapBuilder
public <V> IMapValueDescriptorBuilder<V> mapBuilder(IValueDescriptorCreator<V> elementType)
- Specified by:
mapBuilder
in interfaceIValueDescriptorFactory
- Type Parameters:
V
- Type of the mapped values.- Parameters:
elementType
- Creates the descriptor for the type of the mapped values.- Returns:
- A descriptor builder for a map value (
Map<String, V>
).
-
nullishBuilder
public INullValueDescriptorBuilder nullishBuilder()
- Specified by:
nullishBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a value that can only be
null
.
-
recordBuilder
public IRecordValueDescriptorBuilder recordBuilder()
- Specified by:
recordBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a record value.
-
stringBuilder
public IStringValueDescriptorBuilder stringBuilder()
- Specified by:
stringBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a string value.
-
tupleBuilder
public ITupleValueDescriptorBuilder tupleBuilder()
- Specified by:
tupleBuilder
in interfaceIValueDescriptorFactory
- Returns:
- A descriptor builder for a tuple value with a fixed length and where each element has the same type. Each tuple element defaults to the default value of the given descriptor.
-
unionBuilder
public <D> IUnionValueDescriptorBuilder<D> unionBuilder(Class<D> discriminatorClass)
- Specified by:
unionBuilder
in interfaceIValueDescriptorFactory
- Type Parameters:
D
- Type of the objects used to discriminate between the union members.- Parameters:
discriminatorClass
- Class of the objects used to discriminate between the union members.- Returns:
- A descriptor builder for a union value that uses instances of the given type as discriminators.
-
voidish
public IVoidValueDescriptor voidish()
- Specified by:
voidish
in interfaceIValueDescriptorFactory
- Returns:
- A value descriptor for a void result. This is valid only as a root value for the return value of a method.
-
getInstance
public static IValueDescriptorFactory getInstance()
- Returns:
- The immutable instance of the factory.
-
-