com.google.protobuf
Class Descriptors.EnumDescriptor

java.lang.Object
  extended by com.google.protobuf.Descriptors.EnumDescriptor
Enclosing class:
Descriptors

public static final class Descriptors.EnumDescriptor
extends java.lang.Object

Describes an enum type.


Method Summary
 Descriptors.EnumValueDescriptor findValueByName(java.lang.String name)
          Find an enum value by name.
 Descriptors.EnumValueDescriptor findValueByNumber(int number)
          Find an enum value by number.
 Descriptors.Descriptor getContainingType()
          If this is a nested type, get the outer descriptor, otherwise null.
 Descriptors.FileDescriptor getFile()
          Get the Descriptors.FileDescriptor containing this descriptor.
 java.lang.String getFullName()
          Get the type's fully-qualified name.
 int getIndex()
          Get the index of this descriptor within its parent.
 java.lang.String getName()
          Get the type's unqualified name.
 com.google.protobuf.DescriptorProtos.EnumOptions getOptions()
          Get the EnumOptions, defined in descriptor.proto.
 java.util.List<Descriptors.EnumValueDescriptor> getValues()
          Get a list of defined values for this enum.
 com.google.protobuf.DescriptorProtos.EnumDescriptorProto toProto()
          Convert the descriptor to its protocol message representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIndex

public int getIndex()
Get the index of this descriptor within its parent.

See Also:
Descriptors.Descriptor.getIndex()

toProto

public com.google.protobuf.DescriptorProtos.EnumDescriptorProto toProto()
Convert the descriptor to its protocol message representation.


getName

public java.lang.String getName()
Get the type's unqualified name.


getFullName

public java.lang.String getFullName()
Get the type's fully-qualified name.

See Also:
Descriptors.Descriptor.getFullName()

getFile

public Descriptors.FileDescriptor getFile()
Get the Descriptors.FileDescriptor containing this descriptor.


getContainingType

public Descriptors.Descriptor getContainingType()
If this is a nested type, get the outer descriptor, otherwise null.


getOptions

public com.google.protobuf.DescriptorProtos.EnumOptions getOptions()
Get the EnumOptions, defined in descriptor.proto.


getValues

public java.util.List<Descriptors.EnumValueDescriptor> getValues()
Get a list of defined values for this enum.


findValueByName

public Descriptors.EnumValueDescriptor findValueByName(java.lang.String name)
Find an enum value by name.

Parameters:
name - The unqualified name of the value (e.g. "FOO").
Returns:
the value's decsriptor, or null if not found.

findValueByNumber

public Descriptors.EnumValueDescriptor findValueByNumber(int number)
Find an enum value by number. If multiple enum values have the same number, this returns the first defined value with that number.

Parameters:
number - The value's number.
Returns:
the value's decsriptor, or null if not found.


Copyright © 2008-2010 Google. All Rights Reserved.