Class CMessageBuilder<Builder extends CMessageBuilder<Builder,​Message>,​Message extends PMessage<Message>>

    • Constructor Detail

      • CMessageBuilder

        public CMessageBuilder()
    • Method Detail

      • merge

        @Nonnull
        public Builder merge​(@Nonnull
                             Message from)
        Description copied from class: PMessageBuilder
        Merges the provided message into the builder. Contained messages should in turn be merged and not replaced wholesale. Sets are unioned (addAll) and maps will overwrite / replace on a per-key basis (putAll).
        Specified by:
        merge in class PMessageBuilder<Message extends PMessage<Message>>
        Parameters:
        from - The message to merge values from.
        Returns:
        The builder itself.
      • mutator

        @Nonnull
        public PMessageBuilder<?> mutator​(int key)
        Description copied from class: PMessageBuilder
        Get the builder for the given message contained in this builder. If the sub-builder does not exist, create, either from existing instance or from scratch.
        Specified by:
        mutator in class PMessageBuilder<Message extends PMessage<Message>>
        Parameters:
        key - The field key.
        Returns:
        The field builder.
      • valid

        public boolean valid()
        Description copied from class: PMessageBuilder
        Checks if the current set data is enough to make a valid struct. It will check for all required fields, and if any are missing it will return false.
        Specified by:
        valid in class PMessageBuilder<Message extends PMessage<Message>>
        Returns:
        True for a valid message.
      • validate

        public Builder validate()
        Description copied from class: PMessageBuilder
        Checks if the current set data is enough to make a valid struct. It will check for all required fields, and if any are missing it will throw an IllegalStateException with an appropriate error message.
        Specified by:
        validate in class PMessageBuilder<Message extends PMessage<Message>>
        Returns:
        The builder itself.
      • set

        @Nonnull
        public Builder set​(int key,
                           java.lang.Object value)
        Description copied from class: PMessageBuilder
        Set the provided field value.
        Specified by:
        set in class PMessageBuilder<Message extends PMessage<Message>>
        Parameters:
        key - The key of the field to set.
        value - The value to be set.
        Returns:
        The message builder.
      • isSet

        public boolean isSet​(int key)
        Description copied from class: PMessageBuilder
        Checks if a specific field is set on the builder.
        Specified by:
        isSet in class PMessageBuilder<Message extends PMessage<Message>>
        Parameters:
        key - The key of the field to check.
        Returns:
        True if the field is set.
      • isModified

        public boolean isModified​(int key)
        Description copied from class: PMessageBuilder
        Checks if a specific field is modified on the builder.
        Specified by:
        isModified in class PMessageBuilder<Message extends PMessage<Message>>
        Parameters:
        key - The key of the field to check.
        Returns:
        True if the field is modified.
      • addTo

        @Nonnull
        public Builder addTo​(int key,
                             java.lang.Object value)
        Description copied from class: PMessageBuilder
        Adds a value to a set or list container.
        Specified by:
        addTo in class PMessageBuilder<Message extends PMessage<Message>>
        Parameters:
        key - The key of the container field to add too.
        value - The value to add.
        Returns:
        The builder itself.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • has

        public boolean has​(int key)
        Parameters:
        key - The key of the field.
        Returns:
        Whether the field is present.
      • get

        public <T> T get​(int key)
        Type Parameters:
        T - The return type.
        Parameters:
        key - The key of the field.
        Returns:
        The value of the field.