Class MessageType._Builder

  • All Implemented Interfaces:
    net.morimekta.providence.PBuilder<MessageType>, net.morimekta.providence.serializer.binary.BinaryReader
    Enclosing class:
    MessageType

    public static class MessageType._Builder
    extends net.morimekta.providence.PMessageBuilder<MessageType,​MessageType._Field>
    implements net.morimekta.providence.serializer.binary.BinaryReader
    <variant> { (<field> ([,;])?)* }
    • Constructor Detail

      • _Builder

        public _Builder()
        Make a pmodel.MessageType builder instance.
      • _Builder

        public _Builder​(MessageType base)
        Make a mutating builder off a base pmodel.MessageType.
        Parameters:
        base - The base MessageType
    • Method Detail

      • setDocumentation

        @Nonnull
        public MessageType._Builder setDocumentation​(java.lang.String value)
        Set the documentation field value.
        Parameters:
        value - The new value
        Returns:
        The builder
      • isSetDocumentation

        public boolean isSetDocumentation()
        Checks for presence of the documentation field.
        Returns:
        True if documentation has been set.
      • isModifiedDocumentation

        public boolean isModifiedDocumentation()
        Checks if the documentation field has been modified since the builder was created.
        Returns:
        True if documentation has been modified.
      • clearDocumentation

        @Nonnull
        public MessageType._Builder clearDocumentation()
        Clear the documentation field.
        Returns:
        The builder
      • getDocumentation

        public java.lang.String getDocumentation()
        Returns:
        The documentation field value
      • setVariant

        @Nonnull
        public MessageType._Builder setVariant​(MessageVariant value)
        Set the variant field value.
        Parameters:
        value - The new value
        Returns:
        The builder
      • isSetVariant

        public boolean isSetVariant()
        Checks for presence of the variant field.
        Returns:
        True if variant has been set.
      • isModifiedVariant

        public boolean isModifiedVariant()
        Checks if the variant field has been modified since the builder was created.
        Returns:
        True if variant has been modified.
      • clearVariant

        @Nonnull
        public MessageType._Builder clearVariant()
        Clear the variant field.
        Returns:
        The builder
      • getVariant

        public MessageVariant getVariant()
        Returns:
        The variant field value
      • setName

        @Nonnull
        public MessageType._Builder setName​(java.lang.String value)
        Set the name field value.
        Parameters:
        value - The new value
        Returns:
        The builder
      • isSetName

        public boolean isSetName()
        Checks for presence of the name field.
        Returns:
        True if name has been set.
      • isModifiedName

        public boolean isModifiedName()
        Checks if the name field has been modified since the builder was created.
        Returns:
        True if name has been modified.
      • clearName

        @Nonnull
        public MessageType._Builder clearName()
        Clear the name field.
        Returns:
        The builder
      • getName

        public java.lang.String getName()
        Returns:
        The name field value
      • setFields

        @Nonnull
        public MessageType._Builder setFields​(java.util.Collection<FieldType> value)
        Set the fields field value.
        Parameters:
        value - The new value
        Returns:
        The builder
      • addToFields

        @Nonnull
        public MessageType._Builder addToFields​(FieldType... values)
        Adds entries to the fields list.
        Parameters:
        values - The added value
        Returns:
        The builder
      • isSetFields

        public boolean isSetFields()
        Checks for presence of the fields field.
        Returns:
        True if fields has been set.
      • isModifiedFields

        public boolean isModifiedFields()
        Checks if the fields field has been modified since the builder was created.
        Returns:
        True if fields has been modified.
      • clearFields

        @Nonnull
        public MessageType._Builder clearFields()
        Clear the fields field.
        Returns:
        The builder
      • mutableFields

        public java.util.List<FieldType> mutableFields()
        Returns:
        The mutable fields container
      • setAnnotations

        @Nonnull
        public MessageType._Builder setAnnotations​(java.util.Map<java.lang.String,​java.lang.String> value)
        Set the annotations field value.
        Parameters:
        value - The new value
        Returns:
        The builder
      • putInAnnotations

        @Nonnull
        public MessageType._Builder putInAnnotations​(java.lang.String key,
                                                     java.lang.String value)
        Adds a mapping to the annotations map.
        Parameters:
        key - The inserted key
        value - The inserted value
        Returns:
        The builder
      • isSetAnnotations

        public boolean isSetAnnotations()
        Checks for presence of the annotations field.
        Returns:
        True if annotations has been set.
      • isModifiedAnnotations

        public boolean isModifiedAnnotations()
        Checks if the annotations field has been modified since the builder was created.
        Returns:
        True if annotations has been modified.
      • clearAnnotations

        @Nonnull
        public MessageType._Builder clearAnnotations()
        Clear the annotations field.
        Returns:
        The builder
      • mutableAnnotations

        public java.util.Map<java.lang.String,​java.lang.String> mutableAnnotations()
        Returns:
        The mutable annotations container
      • setStartPos

        @Nonnull
        public MessageType._Builder setStartPos​(FilePos value)
        Set the start_pos field value.

        The start of the definition (position of 'struct' / message type)

        Parameters:
        value - The new value
        Returns:
        The builder
      • setStartPos

        @Nonnull
        public MessageType._Builder setStartPos​(FilePos._Builder builder)
        Set the start_pos field value.

        The start of the definition (position of 'struct' / message type)

        Parameters:
        builder - builder for the new value
        Returns:
        The builder
      • isSetStartPos

        public boolean isSetStartPos()
        Checks for presence of the start_pos field.
        Returns:
        True if start_pos has been set.
      • isModifiedStartPos

        public boolean isModifiedStartPos()
        Checks if the start_pos field has been modified since the builder was created.
        Returns:
        True if start_pos has been modified.
      • clearStartPos

        @Nonnull
        public MessageType._Builder clearStartPos()
        Clear the start_pos field.
        Returns:
        The builder
      • mutableStartPos

        @Nonnull
        public FilePos._Builder mutableStartPos()
        Get the builder for the contained start_pos message field.

        The start of the definition (position of 'struct' / message type)

        Returns:
        The field message builder
      • getStartPos

        public FilePos getStartPos()
        The start of the definition (position of 'struct' / message type)
        Returns:
        The field value
      • setEndPos

        @Nonnull
        public MessageType._Builder setEndPos​(FilePos value)
        Set the end_pos field value.

        The end of the definition (position of '}')

        Parameters:
        value - The new value
        Returns:
        The builder
      • setEndPos

        @Nonnull
        public MessageType._Builder setEndPos​(FilePos._Builder builder)
        Set the end_pos field value.

        The end of the definition (position of '}')

        Parameters:
        builder - builder for the new value
        Returns:
        The builder
      • isSetEndPos

        public boolean isSetEndPos()
        Checks for presence of the end_pos field.
        Returns:
        True if end_pos has been set.
      • isModifiedEndPos

        public boolean isModifiedEndPos()
        Checks if the end_pos field has been modified since the builder was created.
        Returns:
        True if end_pos has been modified.
      • clearEndPos

        @Nonnull
        public MessageType._Builder clearEndPos()
        Clear the end_pos field.
        Returns:
        The builder
      • mutableEndPos

        @Nonnull
        public FilePos._Builder mutableEndPos()
        Get the builder for the contained end_pos message field.

        The end of the definition (position of '}')

        Returns:
        The field message builder
      • getEndPos

        public FilePos getEndPos()
        The end of the definition (position of '}')
        Returns:
        The field value
      • 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
      • mutator

        public net.morimekta.providence.PMessageBuilder mutator​(int key)
        Specified by:
        mutator in class net.morimekta.providence.PMessageBuilder<MessageType,​MessageType._Field>
      • isSet

        public boolean isSet​(int key)
        Specified by:
        isSet in class net.morimekta.providence.PMessageBuilder<MessageType,​MessageType._Field>
      • isModified

        public boolean isModified​(int key)
        Specified by:
        isModified in class net.morimekta.providence.PMessageBuilder<MessageType,​MessageType._Field>
      • validate

        public void validate()
        Specified by:
        validate in class net.morimekta.providence.PMessageBuilder<MessageType,​MessageType._Field>
      • readBinary

        public void readBinary​(net.morimekta.util.io.BigEndianBinaryReader reader,
                               boolean strict)
                        throws java.io.IOException
        Specified by:
        readBinary in interface net.morimekta.providence.serializer.binary.BinaryReader
        Throws:
        java.io.IOException
      • build

        public MessageType build()
        Specified by:
        build in interface net.morimekta.providence.PBuilder<MessageType>