Interface IRecordValueBuilder

  • All Superinterfaces:
    org.apache.commons.lang3.builder.Builder<Map<String,​?>>, IValueBuilder<Map<String,​?>>

    public interface IRecordValueBuilder
    extends IValueBuilder<Map<String,​?>>
    A IValueBuilder for a Map that adheres to a given IRecordValueDescriptor. When no value is given for a property of the record, the default value is used instead. When a property name is given that does not exist on the record, it is ignored.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • property

        <T> IRecordValueBuilder property​(String key,
                                         Class<? extends T> memberClass,
                                         IValueCreator<T> creator)
        Supplies a value for the given property name. When the record does not have that property, the value is ignored.
        Type Parameters:
        T - Type of the property value.
        Parameters:
        key - Name of the property.
        memberClass - Type of the property value.
        creator - A value creator that is given a IValueBuilder and must return the value for the property.
        Returns:
        This builder for chaining method calls.
      • property

        default <T> IRecordValueBuilder property​(String key,
                                                 T value)
        Supplies a value for the given property name. When the record does not have that property, the value is ignored.
        Type Parameters:
        T - Type of the property value.
        Parameters:
        key - Name of the property.
        value - The value for the property. Must be an instance of T.
        Returns:
        This builder for chaining method calls.
      • value

        default IRecordValueBuilder value​(Map<String,​?> value)
        Description copied from interface: IValueBuilder
        Applies the given value to this builder. Implementations are allowed to perform validity checks on the passed value and reject the given value or parts of it (in case of lists etc.) when they do not conform to the restrictions imposed by this builder.
        Specified by:
        value in interface IValueBuilder<Map<String,​?>>
        Parameters:
        value - Sets the value created by this builder.
        Returns:
        This builder instance for chaining method calls.