Interface IRecordValueDescriptorBuilder
-
- All Superinterfaces:
org.apache.commons.lang3.builder.Builder<IRecordValueDescriptor>
,IValueDescriptorBuilder<Map<String,?>,IRecordValueBuilder,IRecordValueDescriptor>
public interface IRecordValueDescriptorBuilder extends IValueDescriptorBuilder<Map<String,?>,IRecordValueBuilder,IRecordValueDescriptor>
A builder for aIRecordValueDescriptor
. Lets you add both optional and required properties. UseIValueDescriptorFactory.recordBuilder()
to create a builder.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IRecordValueDescriptorBuilder
description(String description)
default <T> IRecordValueDescriptorBuilder
optionalDefaultProperty(String key, IValueDescriptor<T,? extends IValueBuilder<T>> descriptor)
Adds an optional property to the record value.<T> IRecordValueDescriptorBuilder
optionalDefaultProperty(String key, IValueDescriptorCreator<T> creator)
Adds an optional property to the record value.default <T> IRecordValueDescriptorBuilder
optionalProperty(String key, IValueDescriptor<T,? extends IValueBuilder<T>> descriptor)
Adds an optional property to the record value.<T> IRecordValueDescriptorBuilder
optionalProperty(String key, IValueDescriptorCreator<T> creator)
Adds an optional property to the record value.default <T> IRecordValueDescriptorBuilder
requiredProperty(String key, IValueDescriptor<T,? extends IValueBuilder<T>> descriptor)
Adds required property to the record value.<T> IRecordValueDescriptorBuilder
requiredProperty(String key, IValueDescriptorCreator<T> creator)
Adds required property to the record value.
-
-
-
Method Detail
-
description
IRecordValueDescriptorBuilder description(String description)
- Specified by:
description
in interfaceIValueDescriptorBuilder<Map<String,?>,IRecordValueBuilder,IRecordValueDescriptor>
- Parameters:
description
- The description for the value. May be either a localized message or an I18N key.- Returns:
- This builder instance for chaining method calls.
-
optionalDefaultProperty
default <T> IRecordValueDescriptorBuilder optionalDefaultProperty(String key, IValueDescriptor<T,? extends IValueBuilder<T>> descriptor)
Adds an optional property to the record value. An optional property may or may not be present. It is usually recommended to userequiredProperty(String, IValueDescriptor)
with a suitable default.When no value is provided for the record, a record with the default values for each property is created. Use this method when you want to include the optional property in that default value.
- Type Parameters:
T
- Type of the property value.- Parameters:
key
- Name of the property in the record. This is the name that can be used to access the value.descriptor
- Descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
optionalDefaultProperty
<T> IRecordValueDescriptorBuilder optionalDefaultProperty(String key, IValueDescriptorCreator<T> creator)
Adds an optional property to the record value. An optional property may or may not be present. It is usually recommended to userequiredProperty(String, IValueDescriptor)
with a suitable default.When no value is provided for the record, a record with the default values for each property is created. Use this method when you want to include the optional property in that default value.
- Type Parameters:
T
- Type of the property value.- Parameters:
key
- Name of the property in the record. This is the name that can be used to access the value.creator
- Method that is given aIValueDescriptorFactory
and return the descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
optionalProperty
default <T> IRecordValueDescriptorBuilder optionalProperty(String key, IValueDescriptor<T,? extends IValueBuilder<T>> descriptor)
Adds an optional property to the record value. An optional property may or may not be present. It is usually recommended to userequiredProperty(String, IValueDescriptor)
with a suitable default.When no value is provided for the record, a record with the default values for each property is created. Use this method when you want to omit the optional property from that default value.
- Type Parameters:
T
- Type of the property value.- Parameters:
key
- Name of the property in the record. This is the name that can be used to access the value.descriptor
- Descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
optionalProperty
<T> IRecordValueDescriptorBuilder optionalProperty(String key, IValueDescriptorCreator<T> creator)
Adds an optional property to the record value. An optional property may or may not be present. It is usually recommended to userequiredProperty(String, IValueDescriptor)
with a suitable default.When no value is provided for the record, a record with the default values for each property is created. Use this method when you want to omit the optional property from that default value.
- Type Parameters:
T
- Type of the property value.- Parameters:
key
- Name of the property in the record. This is the name that can be used to access the value.creator
- Method that is given aIValueDescriptorFactory
and return the descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
requiredProperty
default <T> IRecordValueDescriptorBuilder requiredProperty(String key, IValueDescriptor<T,? extends IValueBuilder<T>> descriptor)
Adds required property to the record value. A required must always be present. When no explicit value is provided, the default value of the value descriptor is used instead.- Type Parameters:
T
- Type of the property value.- Parameters:
key
- Name of the property in the record. This is the name that can be used to access the value.descriptor
- Descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
requiredProperty
<T> IRecordValueDescriptorBuilder requiredProperty(String key, IValueDescriptorCreator<T> creator)
Adds required property to the record value. A required must always be present. When no explicit value is provided, the default value of the value descriptor is used instead.- Type Parameters:
T
- Type of the property value.- Parameters:
key
- Name of the property in the record. This is the name that can be used to access the value.creator
- Method that is given aIValueDescriptorFactory
and return the descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
-