Interface IUnionValueBuilder<D>

  • Type Parameters:
    D - Type of the union discriminator.
    All Superinterfaces:
    org.apache.commons.lang3.builder.Builder<Object>, IValueBuilder<Object>

    public interface IUnionValueBuilder<D>
    extends IValueBuilder<Object>
    A IValueBuilder for creating a union value.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • buildDiscriminatedMember

        IDiscriminatedUnionMember<D,​?> buildDiscriminatedMember()
        Returns:
        The discriminated union member representing the current value of this union builder.
      • value

        <T> IUnionValueBuilder<D> value​(D discriminator,
                                        Class<? extends T> memberClass,
                                        IValueCreator<T> creator)
        Sets the value of the union at the given member discriminator to the given value.
        Type Parameters:
        T - Type of the union member value.
        Parameters:
        discriminator - Discriminator for the union member.
        memberClass - class of the union member value.
        creator - Value creator the value of the union member value.
        Returns:
        This value builder for chaining method calls.
      • value

        default <T> IUnionValueBuilder<D> value​(D discriminator,
                                                T value)
        Sets the value of the union at the given member discriminator to the given value.
        Type Parameters:
        T - Type of the union member value.
        Parameters:
        discriminator - Discriminator for the union member.
        value - The value of the union member value.
        Returns:
        This value builder for chaining method calls.
      • value

        default IUnionValueBuilder<D> value​(IDiscriminatedUnionMember<D,​?> value)
        Sets the value of the union to the given member.
        Parameters:
        discriminator - Discriminator for the union member.
        value - The union member value to set.
        Returns:
        This value builder for chaining method calls.