Class UnknownFieldSetImpl

    • Constructor Detail

      • UnknownFieldSetImpl

        public UnknownFieldSetImpl()
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Description copied from interface: UnknownFieldSet
        Checks if there are any fields in this set.
        Specified by:
        isEmpty in interface UnknownFieldSet
      • readSingleField

        public boolean readSingleField​(int tag,
                                       TagReader input)
                                throws IOException
        Description copied from interface: UnknownFieldSet
        Parse a single field from input and merge it into this set.
        Specified by:
        readSingleField in interface UnknownFieldSet
        Parameters:
        tag - The field's tag number, which was already parsed (tag contains both field id and wire type).
        Returns:
        false if the tag is an end group tag.
        Throws:
        IOException
      • putVarintField

        public void putVarintField​(int tag,
                                   int value)
        Description copied from interface: UnknownFieldSet
        Convenience method for merging a new field containing a single varint value. This is used in particular when an unknown enum value is encountered.
        Specified by:
        putVarintField in interface UnknownFieldSet
        Parameters:
        tag - the field tag (containing both field id and wire type).
      • consumeTag

        public <A> A consumeTag​(int tag)
        Description copied from interface: UnknownFieldSet
        Reads and removes a field value from the set. The field is specified as a tag value composed of the numeric id of the field and the wire type. It's possible that the tag has repeated values; in that case the first one is returned.
        Specified by:
        consumeTag in interface UnknownFieldSet
        Type Parameters:
        A - The expected type of the tag value.
        Parameters:
        tag - the field tag (containing both field id and wire type).
        Returns:
        the first seen value or null if the tag was not found.
      • hasTag

        public boolean hasTag​(int tag)
        Description copied from interface: UnknownFieldSet
        Checks if a tag is present.
        Specified by:
        hasTag in interface UnknownFieldSet
        Parameters:
        tag - the field tag (containing both field id and wire type).
        Returns:
        true if present, false otherwise