Class GeneratedMessage.ExtendableMessage<MessageType extends GeneratedMessage.ExtendableMessage>

    • Method Detail

      • hasExtension

        public final <Type> boolean hasExtension(Extension<MessageType,Type> extension)
        Check if a singular extension is present.
      • getExtensionCount

        public final <Type> int getExtensionCount(Extension<MessageType,List<Type>> extension)
        Get the number of elements in a repeated extension.
      • getExtension

        public final <Type> Type getExtension(Extension<MessageType,Type> extension)
        Get the value of an extension.
      • getExtension

        public final <Type> Type getExtension(Extension<MessageType,List<Type>> extension,
                                              int index)
        Get one element of a repeated extension.
      • extensionsAreInitialized

        protected boolean extensionsAreInitialized()
        Called by subclasses to check if all extensions are initialized.
      • makeExtensionsImmutable

        protected void makeExtensionsImmutable()
        Used by parsing constructors in generated classes.
      • extensionsSerializedSize

        protected int extensionsSerializedSize()
        Called by subclasses to compute the size of extensions.
      • extensionsSerializedSizeAsMessageSet

        protected int extensionsSerializedSizeAsMessageSet()
      • getAllFields

        public Map<Descriptors.FieldDescriptor,Object> getAllFields()
        Description copied from interface: MessageOrBuilder
        Returns a collection of all the fields in this message which are set and their corresponding values. A singular ("required" or "optional") field is set iff hasField() returns true for that field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values are exactly what would be returned by calling MessageOrBuilder.getField(Descriptors.FieldDescriptor) for each field. The map is guaranteed to be a sorted map, so iterating over it will return fields in order by field number.
        If this is for a builder, the returned map may or may not reflect future changes to the builder. Either way, the returned map is itself unmodifiable.
      • hasField

        public boolean hasField(Descriptors.FieldDescriptor field)
        Description copied from interface: MessageOrBuilder
        Returns true if the given field is set. This is exactly equivalent to calling the generated "has" accessor method corresponding to the field.
      • getField

        public Object getField(Descriptors.FieldDescriptor field)
        Description copied from interface: MessageOrBuilder
        Obtains the value of the given field, or the default value if it is not set. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned. For repeated fields, a java.util.List is returned.
      • getRepeatedFieldCount

        public int getRepeatedFieldCount(Descriptors.FieldDescriptor field)
        Description copied from interface: MessageOrBuilder
        Gets the number of elements of a repeated field. This is exactly equivalent to calling the generated "Count" accessor method corresponding to the field.
      • getRepeatedField

        public Object getRepeatedField(Descriptors.FieldDescriptor field,
                                       int index)
        Description copied from interface: MessageOrBuilder
        Gets an element of a repeated field. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned.