public class CodedConstant extends Object
| 构造器和说明 |
|---|
CodedConstant() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List |
asList(String value) |
static String |
capitalize(String str)
Capitalizes a String changing the first letter to title case as per
Character.toTitleCase(char). |
static int |
computeListSize(int order,
List list,
FieldType type,
boolean debug,
File path) |
static int |
computeSize(int order,
Object o,
FieldType type,
boolean list,
boolean debug,
File path)
get object size by
FieldType |
static int |
computeSize(int order,
Object o,
FieldType type,
boolean debug,
File path)
get object size by
FieldType |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor(Class<?> cls) |
static String |
getEnumName(Enum[] e,
int value) |
static String |
getMappedTypeDefined(int order,
FieldType type,
String express,
boolean isList)
get mapped type defined java expression.
|
static String |
getMappedTypeSize(FieldInfo field,
int order,
FieldType type,
boolean isList,
boolean debug,
File path) |
static String |
getMappedWriteCode(FieldInfo field,
String prefix,
int order,
FieldType type,
boolean isList)
get mapped object byte write java expression
|
static String |
getRequiredCheck(int order,
Field field)
get required field check java expression
|
static String |
getRetRequiredCheck(String express,
Field field)
get return required field check java expression
|
static boolean |
isNull(byte o)
check byte is null
|
static boolean |
isNull(char o)
check char is null
|
static boolean |
isNull(double o)
check double is null
|
static boolean |
isNull(float o)
check float is null
|
static boolean |
isNull(int o)
check int is null
|
static boolean |
isNull(long o)
check long is null
|
static boolean |
isNull(Object o)
check object is null
|
static boolean |
isNull(short o)
check short is null
|
static int |
makeTag(int fieldNumber,
int wireType)
make protobuf tag
|
static void |
writeObject(com.google.protobuf.CodedOutputStream out,
int order,
FieldType type,
Object o,
boolean list)
Write object to byte array by
FieldType |
static void |
writeToList(com.google.protobuf.CodedOutputStream out,
int order,
FieldType type,
List list)
write list to
CodedOutputStream object. |
public static String getMappedTypeDefined(int order, FieldType type, String express, boolean isList)
order - field ordertype - field typeexpress - java expressionisList - is field type is a Listpublic static String getMappedTypeSize(FieldInfo field, int order, FieldType type, boolean isList, boolean debug, File path)
field - fieldorder - field ordertype - field typeisList - is field type is a Listdebug - debug mode if true enable debug.path - public static int computeListSize(int order,
List list,
FieldType type,
boolean debug,
File path)
order - field orderlist - field valuetype - field type of list objdebug - path - public static int computeSize(int order,
Object o,
FieldType type,
boolean debug,
File path)
FieldTypeorder - o - type - public static int computeSize(int order,
Object o,
FieldType type,
boolean list,
boolean debug,
File path)
FieldTypeo - type - public static String getMappedWriteCode(FieldInfo field, String prefix, int order, FieldType type, boolean isList)
order - field ordertype - field typepublic static void writeToList(com.google.protobuf.CodedOutputStream out,
int order,
FieldType type,
List list)
throws IOException
CodedOutputStream object.out - target output stream to writeorder - field ordertype - field typelist - target list object to be serializedIOExceptionpublic static void writeObject(com.google.protobuf.CodedOutputStream out,
int order,
FieldType type,
Object o,
boolean list)
throws IOException
FieldTypeout - order - type - o - IOExceptionpublic static String getRequiredCheck(int order, Field field)
order - field orderfield - java fieldpublic static String getRetRequiredCheck(String express, Field field)
express - java expressionfield - java fieldpublic static boolean isNull(Object o)
o - to checkpublic static boolean isNull(double o)
o - to checkpublic static boolean isNull(int o)
o - to checkpublic static boolean isNull(byte o)
o - to checkpublic static boolean isNull(short o)
o - to checkpublic static boolean isNull(long o)
o - to checkpublic static boolean isNull(float o)
o - to checkpublic static boolean isNull(char o)
o - to checkpublic static String capitalize(String str)
Capitalizes a String changing the first letter to title case as per Character.toTitleCase(char). No other
letters are changed.
str - the String to capitalize, may be nullnull if null String inputpublic static int makeTag(int fieldNumber,
int wireType)
fieldNumber - field number orderwireType - wireformat typepublic static com.google.protobuf.Descriptors.Descriptor getDescriptor(Class<?> cls) throws IOException
IOExceptionCopyright © 2016 Baidu, Inc.. All rights reserved.