Interface PMessageOrBuilder<Message extends PMessage<Message>>

    • Method Detail

      • has

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

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

        default <F extends PField<Message>> boolean has​(@Nonnull
                                                        F field)
        Type Parameters:
        F - The message field type.
        Parameters:
        field - The field.
        Returns:
        Whether the field is present.
      • get

        default <T,​F extends PField<Message>> T get​(@Nonnull
                                                          F field)
        Type Parameters:
        T - The return type.
        F - The message field type.
        Parameters:
        field - The field.
        Returns:
        Whether the field is present.
      • toMessage

        @Nonnull
        default Message toMessage()
        Cast the message or builder instance to it's instance, or build so it becomes a new instance from the builder.
        Returns:
        The message instance.
      • toBuilder

        @Nonnull
        default <Builder extends PMessageBuilder<Message>> Builder toBuilder()
        Cast the message or builder instance to it's builder or mutate the instance so we have a fresh builder.
        Type Parameters:
        Builder - The builder type.
        Returns:
        The builder instance.