Interface PField

  • All Known Implementing Classes:
    Any._Field, Empty._Field, PApplicationException._Field

    public interface PField
    Field descriptor. All struct variants contains a set of fields. This interface describes the properties each field has. It is an interface so the fields themselves may be implemented as an enum.
    • Method Detail

      • getId

        int getId()
        Returns:
        The field numeric ID or key.
      • getRequirement

        @Nonnull
        PRequirement getRequirement()
        Returns:
        How the field is required for validity.
      • getType

        @Nonnull
        default PType getType()
        Returns:
        The data type of the field.
      • getDescriptor

        @Nonnull
        PDescriptor getDescriptor()
        Returns:
        The type descriptor for the field data type.
      • getName

        @Nonnull
        java.lang.String getName()
        Returns:
        The field name (original).
      • hasDefaultValue

        boolean hasDefaultValue()
        Returns:
        Whether the field has an explicit default value.
      • getDefaultValue

        java.lang.Object getDefaultValue()
        Returns:
        The default value or null if none. This should return value also where the field has an implicit default value, e.g. numerical types.
      • asString

        static java.lang.String asString​(PField field)
        asString helper for fields.
        Parameters:
        field - The field to make string of.
        Returns:
        The field asString.