public abstract class Field extends Object
This is used to calculate field names and handle ambiguous extensions. Additional logic should be handled by subclasses.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Field.Factory<T extends Field>
A factory for field types.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Field(com.google.protobuf.Descriptors.FieldDescriptor fieldDesc) |
| Modifier and Type | Method and Description |
|---|---|
protected static RuntimeException |
ambiguousFieldsError(String name,
Set<? extends Field> fields) |
com.google.protobuf.Descriptors.FieldDescriptor |
getDescriptor() |
static <T extends Field> |
getFieldsForType(com.google.protobuf.Descriptors.Descriptor descriptor,
Set<com.google.protobuf.Descriptors.FieldDescriptor> extensions,
Field.Factory<T> factory)
Returns the set of fields indexed by soy accessor name for the given type.
|
String |
getName()
Return the name of this member field.
|
boolean |
shouldCheckFieldPresenceToEmulateJspbNullability()
Returns whether or not we need to check for field presence to handle nullability semantics on
the server.
|
public static <T extends Field> com.google.common.collect.ImmutableMap<String,T> getFieldsForType(com.google.protobuf.Descriptors.Descriptor descriptor, Set<com.google.protobuf.Descriptors.FieldDescriptor> extensions, Field.Factory<T> factory)
public final String getName()
public final boolean shouldCheckFieldPresenceToEmulateJspbNullability()
public final com.google.protobuf.Descriptors.FieldDescriptor getDescriptor()
protected static RuntimeException ambiguousFieldsError(String name, Set<? extends Field> fields)