public class EnumType extends ProtoElement
| Modifier and Type | Method and Description |
|---|---|
static EnumType |
create(ProtoContainerElement parent,
com.google.protobuf.DescriptorProtos.EnumDescriptorProto proto,
java.lang.String path)
Creates an enum backed up by the given proto.
|
java.util.Map<com.google.protobuf.Descriptors.FieldDescriptor,java.lang.Object> |
getOptionFields()
Return this element's options from the proto.
|
com.google.protobuf.DescriptorProtos.EnumDescriptorProto |
getProto()
Returns the underlying proto representation.
|
java.lang.Iterable<EnumValue> |
getReachableValues()
Returns the enum values for which
ProtoElement.isReachable() is true. |
com.google.common.collect.ImmutableList<EnumValue> |
getValues()
Returns the values.
|
com.google.protobuf.Enum |
getVisibleProto()
Returns a proto representation that includes visible values only.
|
boolean |
hasHiddenValue()
Returns whether any of the enum's values are hidden.
|
boolean |
isDeprecated()
Returns true if this object represents something that is configured as deprecated.
|
EnumValue |
lookupValue(java.lang.String name)
Looks up the value by its name.
|
void |
setValueByNameMap(com.google.common.collect.ImmutableMap<java.lang.String,EnumValue> valueByName)
For setting the value-by-name map.
|
java.lang.String |
toString() |
getFile, getFullName, getLocation, getModel, getParent, getSimpleName, getSyntax, isReachableaddAttribute, getAttribute, getAttributeOrDefault, hasAttribute, putAttribute, removeAttributepublic static EnumType create(ProtoContainerElement parent, com.google.protobuf.DescriptorProtos.EnumDescriptorProto proto, java.lang.String path)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isDeprecated()
isDeprecated in class ProtoElementpublic com.google.protobuf.DescriptorProtos.EnumDescriptorProto getProto()
public java.util.Map<com.google.protobuf.Descriptors.FieldDescriptor,java.lang.Object> getOptionFields()
ProtoElementgetOptionFields in class ProtoElementpublic com.google.protobuf.Enum getVisibleProto()
public com.google.common.collect.ImmutableList<EnumValue> getValues()
public java.lang.Iterable<EnumValue> getReachableValues()
ProtoElement.isReachable() is true.public boolean hasHiddenValue()
@Nullable public EnumValue lookupValue(java.lang.String name)
public void setValueByNameMap(com.google.common.collect.ImmutableMap<java.lang.String,EnumValue> valueByName)