Class DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase.Adapter<V>

    • Constructor Detail

      • Adapter

        protected Adapter​(FieldAttributeAppender.Factory fieldAttributeAppenderFactory,
                          Transformer<FieldDescription> transformer,
                          java.lang.Object defaultValue)
        Creates a new field adapter.
        Parameters:
        fieldAttributeAppenderFactory - The field attribute appender factory to apply.
        transformer - The field transformer to apply.
        defaultValue - The field's default value or null if no value is to be defined.
    • Method Detail

      • attribute

        public DynamicType.Builder.FieldDefinition.Optional<V> attribute​(FieldAttributeAppender.Factory fieldAttributeAppenderFactory)
        Applies the supplied attribute appender factory onto the previously defined or matched field.
        Parameters:
        fieldAttributeAppenderFactory - The field attribute appender factory that should be applied on the previously defined or matched field.
        Returns:
        A new builder that is equal to this builder but with the supplied field attribute appender factory applied to the previously defined or matched field.
      • transform

        public DynamicType.Builder.FieldDefinition.Optional<V> transform​(Transformer<FieldDescription> transformer)
        Applies the supplied transformer onto the previously defined or matched field. The transformed field is written as it is and it not subject to any validations.
        Parameters:
        transformer - The transformer to apply to the previously defined or matched field.
        Returns:
        A new builder that is equal to this builder but with the supplied field transformer applied to the previously defined or matched field.
      • materialize

        protected abstract DynamicType.Builder.FieldDefinition.Optional<V> materialize​(FieldAttributeAppender.Factory fieldAttributeAppenderFactory,
                                                                                       Transformer<FieldDescription> transformer,
                                                                                       java.lang.Object defaultValue)
        Creates a new optional field definition for which all of the supplied values are represented.
        Parameters:
        fieldAttributeAppenderFactory - The field attribute appender factory to apply.
        transformer - The field transformer to apply.
        defaultValue - The field's default value or null if no value is to be defined.
        Returns:
        A new field definition that represents the supplied values.