protobuf package.
Others should not use this class directly.
| Modifier and Type | Field and Description |
|---|---|
| protected static final Charset | |
| public static final Object | LAZY_INIT_LOCK
An object to provide synchronization when lazily initializing static fields
of |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| protected static final Charset |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static byte[] | bytesDefaultValue(String bytes)
Helper called by generated code to construct default values for bytes fields. |
| public static void | cloneUnknownFieldData(ExtendableMessageNano<M extends ExtendableMessageNano<M>> original, ExtendableMessageNano<M extends ExtendableMessageNano<M>> cloned)
|
| public static <K, V> int | |
| public static byte[] | copyFromUtf8(final String text)
Helper function to convert a string into UTF-8 while turning the UnsupportedEncodingException to a RuntimeException. |
| public static boolean | equals(int[] field1, int[] field2)
Checks repeated int field equality; null-value and 0-length fields are considered equal. |
| public static boolean | equals(long[] field1, long[] field2)
Checks repeated long field equality; null-value and 0-length fields are considered equal. |
| public static boolean | equals(float[] field1, float[] field2)
Checks repeated float field equality; null-value and 0-length fields are considered equal. |
| public static boolean | equals(double[] field1, double[] field2)
Checks repeated double field equality; null-value and 0-length fields are considered equal. |
| public static boolean | equals(boolean[] field1, boolean[] field2)
Checks repeated boolean field equality; null-value and 0-length fields are considered equal. |
| public static boolean | |
| public static boolean | |
| public static <K, V> boolean | |
| private static boolean | |
| public static int | |
| public static int | |
| public static int | |
| public static int | |
| public static int | |
| public static int | |
| public static int | |
| public static <K, V> int | |
| private static int | |
| public static final <K, V> Map | Returns: the map fieldthe input byte buffer input, Map<K, V> the map field; may be null, in which case a map will be
instantiated using the map, MapFactories.MapFactories.key type, as defined in InternalNano.TYPE_* keyType, int value type, as defined in InternalNano.TYPE_* valueType, V an new instance of the value, if the value is a TYPE_MESSAGE;
otherwise this parameter can be null and will be ignored. value, int wire tag for the key keyTag, int wire tag for the value valueTag)Merges the map entry into the map field. |
| private static Object | |
| public static <K, V> void | serializeMapField(CodedOutputByteBufferNano output, Map<K, V> map, int number, int keyType, int valueType)
|
| public static String | stringDefaultValue(String bytes)
Helper called by generated code to construct default values for string fields. |
| ISO_8859_1 | back to summary |
|---|---|
| protected static final Charset ISO_8859_1 | |
| LAZY_INIT_LOCK | back to summary |
|---|---|
| public static final Object LAZY_INIT_LOCK An object to provide synchronization when lazily initializing static fields
of To enable earlier versions of ProGuard to inline short methods from a generated MessageNano subclass to the call sites, that class must not have a class initializer, which will be created if there is any static variable initializers. To lazily initialize the static variables in a thread-safe manner, the initialization code will synchronize on this object. | |
| TYPE_BOOL | back to summary |
|---|---|
| public static final int TYPE_BOOL | |
| TYPE_BYTES | back to summary |
|---|---|
| public static final int TYPE_BYTES | |
| TYPE_DOUBLE | back to summary |
|---|---|
| public static final int TYPE_DOUBLE | |
| TYPE_ENUM | back to summary |
|---|---|
| public static final int TYPE_ENUM | |
| TYPE_FIXED32 | back to summary |
|---|---|
| public static final int TYPE_FIXED32 | |
| TYPE_FIXED64 | back to summary |
|---|---|
| public static final int TYPE_FIXED64 | |
| TYPE_FLOAT | back to summary |
|---|---|
| public static final int TYPE_FLOAT | |
| TYPE_GROUP | back to summary |
|---|---|
| public static final int TYPE_GROUP | |
| TYPE_INT32 | back to summary |
|---|---|
| public static final int TYPE_INT32 | |
| TYPE_INT64 | back to summary |
|---|---|
| public static final int TYPE_INT64 | |
| TYPE_MESSAGE | back to summary |
|---|---|
| public static final int TYPE_MESSAGE | |
| TYPE_SFIXED32 | back to summary |
|---|---|
| public static final int TYPE_SFIXED32 | |
| TYPE_SFIXED64 | back to summary |
|---|---|
| public static final int TYPE_SFIXED64 | |
| TYPE_SINT32 | back to summary |
|---|---|
| public static final int TYPE_SINT32 | |
| TYPE_SINT64 | back to summary |
|---|---|
| public static final int TYPE_SINT64 | |
| TYPE_STRING | back to summary |
|---|---|
| public static final int TYPE_STRING | |
| TYPE_UINT32 | back to summary |
|---|---|
| public static final int TYPE_UINT32 | |
| TYPE_UINT64 | back to summary |
|---|---|
| public static final int TYPE_UINT64 | |
| UTF_8 | back to summary |
|---|---|
| protected static final Charset UTF_8 | |
| InternalNano | back to summary |
|---|---|
| private InternalNano() | |
| bytesDefaultValue | back to summary |
|---|---|
| public static byte[] bytesDefaultValue(String bytes) Helper called by generated code to construct default values for bytes fields.
This is a lot like | |
| cloneUnknownFieldData | back to summary |
|---|---|
| public static void cloneUnknownFieldData(ExtendableMessageNano<M extends ExtendableMessageNano<M>> original, ExtendableMessageNano<M extends ExtendableMessageNano<M>> cloned) | |
| computeMapFieldSize | back to summary |
|---|---|
| public static <K, V> int computeMapFieldSize(Map<K, V> map, int number, int keyType, int valueType) | |
| copyFromUtf8 | back to summary |
|---|---|
| public static byte[] copyFromUtf8(final String text) Helper function to convert a string into UTF-8 while turning the UnsupportedEncodingException to a RuntimeException. | |
| equals | back to summary |
|---|---|
| public static boolean equals(int[] field1, int[] field2) Checks repeated int field equality; null-value and 0-length fields are considered equal. | |
| equals | back to summary |
|---|---|
| public static boolean equals(long[] field1, long[] field2) Checks repeated long field equality; null-value and 0-length fields are considered equal. | |
| equals | back to summary |
|---|---|
| public static boolean equals(float[] field1, float[] field2) Checks repeated float field equality; null-value and 0-length fields are considered equal. | |
| equals | back to summary |
|---|---|
| public static boolean equals(double[] field1, double[] field2) Checks repeated double field equality; null-value and 0-length fields are considered equal. | |
| equals | back to summary |
|---|---|
| public static boolean equals(boolean[] field1, boolean[] field2) Checks repeated boolean field equality; null-value and 0-length fields are considered equal. | |
| equals | back to summary |
|---|---|
| public static boolean equals(byte[][] field1, byte[][] field2) Checks repeated bytes field equality. Only non-null elements are tested. Returns true if the two fields have the same sequence of non-null elements. Null-value fields and fields of any length with only null elements are considered equal. | |
| equals | back to summary |
|---|---|
| public static boolean equals(Object[] field1, Object[] field2) Checks repeated string/message field equality. Only non-null elements are tested. Returns true if the two fields have the same sequence of non-null elements. Null-value fields and fields of any length with only null elements are considered equal. | |
| equals | back to summary |
|---|---|
| public static <K, V> boolean equals(Map<K, V> a, Map<K, V> b) Checks whether two | |
| equalsMapValue | back to summary |
|---|---|
| private static boolean equalsMapValue(Object a, Object b) | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(int[] field) Computes the hash code of a repeated int field. Null-value and 0-length fields have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(long[] field) Computes the hash code of a repeated long field. Null-value and 0-length fields have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(float[] field) Computes the hash code of a repeated float field. Null-value and 0-length fields have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(double[] field) Computes the hash code of a repeated double field. Null-value and 0-length fields have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(boolean[] field) Computes the hash code of a repeated boolean field. Null-value and 0-length fields have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(byte[][] field) Computes the hash code of a repeated bytes field. Only the sequence of all non-null elements are used in the computation. Null-value fields and fields of any length with only null elements have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static int hashCode(Object[] field) Computes the hash code of a repeated string/message field. Only the sequence of all non-null elements are used in the computation. Null-value fields and fields of any length with only null elements have the same hash code. | |
| hashCode | back to summary |
|---|---|
| public static <K, V> int hashCode(Map<K, V> map) | |
| hashCodeForMap | back to summary |
|---|---|
| private static int hashCodeForMap(Object o) | |
| mergeMapEntry | back to summary |
|---|---|
| public static final <K, V> Map Merges the map entry into the map field. Note this is only supposed to be called by generated messages.
| |
| primitiveDefaultValue | back to summary |
|---|---|
| private static Object primitiveDefaultValue(int type) | |
| serializeMapField | back to summary |
|---|---|
| public static <K, V> void serializeMapField(CodedOutputByteBufferNano output, Map<K, V> map, int number, int keyType, int valueType) throws IOException | |
| stringDefaultValue | back to summary |
|---|---|
| public static String stringDefaultValue(String bytes) Helper called by generated code to construct default values for string fields. The protocol compiler does not actually contain a UTF-8 decoder -- it just pushes UTF-8-encoded text around without touching it. The one place where this presents a problem is when generating Java string literals. Unicode characters in the string literal would normally need to be encoded using a Unicode escape sequence, which would require decoding them. To get around this, protoc instead embeds the UTF-8 bytes into the generated code and leaves it to the runtime library to decode them. It gets worse, though. If protoc just generated a byte array, like: new byte[] {0x12, 0x34, 0x56, 0x78} Java actually generates *code* which allocates an array and then fills in each value. This is much less efficient than just embedding the bytes directly into the bytecode. To get around this, we need another work-around. String literals are embedded directly, so protoc actually generates a string literal corresponding to the bytes. The easiest way to do this is to use the ISO-8859-1 character set, which corresponds to the first 256 characters of the Unicode range. Protoc can then use good old CEscape to generate the string. So we have a string literal which represents a set of bytes which represents another string. This function -- stringDefaultValue -- converts from the generated string to the string we actually want. The generated code calls this automatically. | |