Class PMessageDescriptor<T extends PMessage<T>>

    • Constructor Detail

      • PMessageDescriptor

        public PMessageDescriptor​(java.lang.String programName,
                                  java.lang.String name,
                                  java.util.function.Supplier<PMessageBuilder<T>> builderSupplier,
                                  boolean simple)
    • Method Detail

      • getFields

        @Nonnull
        public abstract PField<T>[] getFields()
        Returns:
        An unmodifiable list of fields that the struct holds.
      • findFieldByName

        @Nullable
        public abstract PField<T> findFieldByName​(java.lang.String name)
        Parameters:
        name - Name of field to get.
        Returns:
        The field if present.
      • findFieldByPojoName

        public abstract PField<T> findFieldByPojoName​(java.lang.String pojoName)
        Parameters:
        pojoName - POJO name of field.
        Returns:
        The field if present.
      • findFieldById

        @Nullable
        public abstract PField<T> findFieldById​(int id)
        Parameters:
        id - The ID of the field to get.
        Returns:
        The field if present.
      • fieldForName

        @Nonnull
        public PField<T> fieldForName​(java.lang.String name)
        Parameters:
        name - The name of the field to get.
        Returns:
        The field.
        Throws:
        java.lang.IllegalArgumentException - If not present.
      • fieldForPojoName

        @Nonnull
        public PField<T> fieldForPojoName​(java.lang.String pojoName)
        Parameters:
        pojoName - The POJO name of the field to get.
        Returns:
        The field.
        Throws:
        java.lang.IllegalArgumentException - If not present.
      • getImplementing

        @Nullable
        public PInterfaceDescriptor<?> getImplementing()
        Get interface descriptor this message implements.
        Returns:
        The interface descriptor or null if not implementing declared interface.
      • fieldForId

        @Nonnull
        public PField<T> fieldForId​(int id)
        Parameters:
        id - The ID of the field to get.
        Returns:
        The field.
        Throws:
        java.lang.IllegalArgumentException - If not present.
      • getVariant

        @Nonnull
        public abstract PMessageVariant getVariant()
        Returns:
        The struct variant.
      • isSimple

        public boolean isSimple()
        Returns:
        True if the message is simple. A simple message contains no containers, and no sub-messages.
      • getType

        @Nonnull
        public PType getType()
        Returns:
        Get the field type.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getBuilderSupplier

        protected java.util.function.Supplier<PMessageBuilder<T>> getBuilderSupplier()
        Get the actual builder builderSupplier instance. For contained structs only.
        Returns:
        The builder builderSupplier.