Interface IRecordValueDescriptorBuilder
- All Superinterfaces:
org.apache.commons.lang3.builder.Builder<IRecordValueDescriptor>, IValueDescriptorBuilder<Map<String,?>, IRecordValueBuilder, IRecordValueDescriptor>
IRecordValueDescriptor. Lets you add both optional and required properties. Use
IValueDescriptorFactory.recordBuilder() to create a builder.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String key, Object value) Adds a custom attribute to the value descriptor.addAttributes(Map<String, Object> attributes) Adds custom attributes to the value descriptor.attributes(Map<String, Object> attributes) Set the custom attributes for the value descriptor.description(String description) Deprecated.default IRecordValueDescriptorBuilderoptionalDefaultProperty(String key, IValueDescriptor<?, ?> descriptor) Adds an optional property to the record value.optionalDefaultProperty(String key, IValueDescriptorCreator creator) Adds an optional property to the record value.default IRecordValueDescriptorBuilderoptionalProperty(String key, IValueDescriptor<?, ?> descriptor) Adds an optional property to the record value.optionalProperty(String key, IValueDescriptorCreator creator) Adds an optional property to the record value.default IRecordValueDescriptorBuilderrequiredProperty(String key, IValueDescriptor<?, ?> descriptor) Adds required property to the record value.requiredProperty(String key, IValueDescriptorCreator creator) Adds required property to the record value.Methods inherited from interface org.apache.commons.lang3.builder.Builder
build
-
Method Details
-
addAttribute
Description copied from interface:IValueDescriptorBuilderAdds a custom attribute to the value descriptor. This can be used to store additional metadata about the value that is not covered by the standard properties of the descriptor. The exact meaning of the attributes depends on the context in which the descriptor is used.See
StandardValueDescriptorAttributesfor some standard attribute keys and values you can use.- Specified by:
addAttributein interfaceIValueDescriptorBuilder<Map<String,?>, IRecordValueBuilder, IRecordValueDescriptor> - Parameters:
key- The attribute key.value- The attribute value.- Returns:
- This builder instance for chaining method calls.
- See Also:
-
addAttributes
Description copied from interface:IValueDescriptorBuilderAdds custom attributes to the value descriptor. These can be used to store additional metadata about the value that is not covered by the standard properties of the descriptor. The exact meaning of the attributes depends on the context in which the descriptor is used.See
StandardValueDescriptorAttributesfor some standard attribute keys and values you can use.- Specified by:
addAttributesin interfaceIValueDescriptorBuilder<Map<String,?>, IRecordValueBuilder, IRecordValueDescriptor> - Returns:
- This builder instance for chaining method calls.
- See Also:
-
attributes
Description copied from interface:IValueDescriptorBuilderSet the custom attributes for the value descriptor. These can be used to store additional metadata about the value that is not covered by the standard properties of the descriptor. The exact meaning of the attributes depends on the context in which the descriptor is used.See
StandardValueDescriptorAttributesfor some standard attribute keys and values you can use.- Specified by:
attributesin interfaceIValueDescriptorBuilder<Map<String,?>, IRecordValueBuilder, IRecordValueDescriptor> - Returns:
- This builder instance for chaining method calls.
- See Also:
-
description
Deprecated.Description copied from interface:IValueDescriptorBuilderSets the description for the value. This description can be used in UIs to provide additional information about the value to users. It can be either a localized message or an I18N key that will be resolved at runtime.- Specified by:
descriptionin interfaceIValueDescriptorBuilder<Map<String,?>, IRecordValueBuilder, IRecordValueDescriptor> - Parameters:
description- The description for the value.- Returns:
- This builder instance for chaining method calls.
-
optionalDefaultProperty
@CanIgnoreReturnValue default IRecordValueDescriptorBuilder optionalDefaultProperty(String key, IValueDescriptor<?, ?> 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.
- 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
@CanIgnoreReturnValue IRecordValueDescriptorBuilder optionalDefaultProperty(String key, IValueDescriptorCreator 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.
- 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 aIValueDescriptorFactoryand return the descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
optionalProperty
@CanIgnoreReturnValue default IRecordValueDescriptorBuilder optionalProperty(String key, IValueDescriptor<?, ?> 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.
- 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
@CanIgnoreReturnValue IRecordValueDescriptorBuilder optionalProperty(String key, IValueDescriptorCreator 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.
- 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 aIValueDescriptorFactoryand return the descriptor for the property value.- Returns:
- This builder for chaining method calls.
-
requiredProperty
@CanIgnoreReturnValue default IRecordValueDescriptorBuilder requiredProperty(String key, IValueDescriptor<?, ?> 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.- 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
@CanIgnoreReturnValue IRecordValueDescriptorBuilder requiredProperty(String key, IValueDescriptorCreator 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.- 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 aIValueDescriptorFactoryand return the descriptor for the property value.- Returns:
- This builder for chaining method calls.
-