public enum PPrimitive extends Enum<PPrimitive> implements PDescriptor
These are the basic types used in the thrift structure except containers.
| Enum Constant and Description |
|---|
BINARY |
BOOL |
BYTE |
DOUBLE |
I16 |
I32 |
I64 |
STRING |
VOID |
| Modifier and Type | Method and Description |
|---|---|
static PPrimitive |
findByName(String name)
Find primitive by name.
|
Object |
getDefaultValue() |
String |
getName()
The name of the type is the Identifier string from the IDL.
|
Type |
getNativeType()
Get the java native type for the given primitive.
|
String |
getProgramName()
The package name is derived form the .thrift file name that is parsed or
if read from serialized format is explicit.
|
String |
getQualifiedName(String programContext)
This will return the qualified name of the type given the program context.
|
PType |
getType() |
boolean |
isNativePrimitive() |
PPrimitiveProvider |
provider()
Get the descriptor provider for the primitive.
|
String |
toString() |
static PPrimitive |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PPrimitive[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfgetQualifiedNamepublic static final PPrimitive VOID
public static final PPrimitive BOOL
public static final PPrimitive BYTE
public static final PPrimitive I16
public static final PPrimitive I32
public static final PPrimitive I64
public static final PPrimitive DOUBLE
public static final PPrimitive STRING
public static final PPrimitive BINARY
public static PPrimitive[] values()
for (PPrimitive c : PPrimitive.values()) System.out.println(c);
public static PPrimitive valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null@Nonnull public PPrimitiveProvider provider()
public String getProgramName()
PDescriptorgetProgramName in interface PDescriptor@Nonnull public String getName()
PDescriptorgetName in interface PDescriptor@Nonnull public String getQualifiedName(String programContext)
PDescriptorgetQualifiedName in interface PDescriptorprogramContext - The program which the type should be referenced from.public String toString()
toString in class Enum<PPrimitive>@Nonnull public PType getType()
getType in interface PDescriptorpublic Object getDefaultValue()
getDefaultValue in interface PDescriptorpublic boolean isNativePrimitive()
public static PPrimitive findByName(@Nonnull String name)
name - The name of the primitive.public Type getNativeType()
Copyright © 2015–2020 morimekta.net. All rights reserved.