Interface PUnion<Union extends PUnion<Union,​Field>,​Field extends PField>

  • All Superinterfaces:
    java.lang.Comparable<Union>, PMessage<Union,​Field>, PValue<Union>, net.morimekta.util.Stringable

    public interface PUnion<Union extends PUnion<Union,​Field>,​Field extends PField>
    extends PMessage<Union,​Field>
    Base class for all unions.
    • Method Detail

      • unionFieldIsSet

        boolean unionFieldIsSet()
        Returns:
        Returns true if the union has a field set. If true unionField() will not throw an exception.
      • unionField

        @Nonnull
        Field unionField()
        The user should be able to assume that this value never is null.
        Returns:
        The field set on the union.
        Throws:
        java.lang.IllegalStateException - If no field is set.