aboutsummaryrefslogtreecommitdiff
path: root/java/core/src/main/java/com/google/protobuf/MapEntryLite.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/core/src/main/java/com/google/protobuf/MapEntryLite.java')
-rw-r--r--java/core/src/main/java/com/google/protobuf/MapEntryLite.java60
1 files changed, 30 insertions, 30 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/MapEntryLite.java b/java/core/src/main/java/com/google/protobuf/MapEntryLite.java
index dcb5dfad..ca2a3c2a 100644
--- a/java/core/src/main/java/com/google/protobuf/MapEntryLite.java
+++ b/java/core/src/main/java/com/google/protobuf/MapEntryLite.java
@@ -37,11 +37,10 @@ import java.util.Map;
/**
* Implements the lite version of map entry messages.
*
- * This class serves as an utility class to help do serialization/parsing of
- * map entries. It's used in generated code and also in the full version
- * MapEntry message.
+ * <p>This class serves as an utility class to help do serialization/parsing of map entries. It's
+ * used in generated code and also in the full version MapEntry message.
*
- * Protobuf internal. Users shouldn't use.
+ * <p>Protobuf internal. Users shouldn't use.
*/
public class MapEntryLite<K, V> {
@@ -52,8 +51,10 @@ public class MapEntryLite<K, V> {
public final V defaultValue;
public Metadata(
- WireFormat.FieldType keyType, K defaultKey,
- WireFormat.FieldType valueType, V defaultValue) {
+ WireFormat.FieldType keyType,
+ K defaultKey,
+ WireFormat.FieldType valueType,
+ V defaultValue) {
this.keyType = keyType;
this.defaultKey = defaultKey;
this.valueType = valueType;
@@ -70,8 +71,7 @@ public class MapEntryLite<K, V> {
/** Creates a default MapEntryLite message instance. */
private MapEntryLite(
- WireFormat.FieldType keyType, K defaultKey,
- WireFormat.FieldType valueType, V defaultValue) {
+ WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue) {
this.metadata = new Metadata<K, V>(keyType, defaultKey, valueType, defaultValue);
this.key = defaultKey;
this.value = defaultValue;
@@ -95,16 +95,13 @@ public class MapEntryLite<K, V> {
/**
* Creates a default MapEntryLite message instance.
*
- * This method is used by generated code to create the default instance for
- * a map entry message. The created default instance should be used to create
- * new map entry messages of the same type. For each map entry message, only
- * one default instance should be created.
+ * <p>This method is used by generated code to create the default instance for a map entry
+ * message. The created default instance should be used to create new map entry messages of the
+ * same type. For each map entry message, only one default instance should be created.
*/
public static <K, V> MapEntryLite<K, V> newDefaultInstance(
- WireFormat.FieldType keyType, K defaultKey,
- WireFormat.FieldType valueType, V defaultValue) {
- return new MapEntryLite<K, V>(
- keyType, defaultKey, valueType, defaultValue);
+ WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue) {
+ return new MapEntryLite<K, V>(keyType, defaultKey, valueType, defaultValue);
}
static <K, V> void writeTo(CodedOutputStream output, Metadata<K, V> metadata, K key, V value)
@@ -120,8 +117,11 @@ public class MapEntryLite<K, V> {
@SuppressWarnings("unchecked")
static <T> T parseField(
- CodedInputStream input, ExtensionRegistryLite extensionRegistry,
- WireFormat.FieldType type, T value) throws IOException {
+ CodedInputStream input,
+ ExtensionRegistryLite extensionRegistry,
+ WireFormat.FieldType type,
+ T value)
+ throws IOException {
switch (type) {
case MESSAGE:
MessageLite.Builder subBuilder = ((MessageLite) value).toBuilder();
@@ -137,9 +137,9 @@ public class MapEntryLite<K, V> {
}
/**
- * Serializes the provided key and value as though they were wrapped by a {@link MapEntryLite}
- * to the output stream. This helper method avoids allocation of a {@link MapEntryLite}
- * built with a key and value and is called from generated code directly.
+ * Serializes the provided key and value as though they were wrapped by a {@link MapEntryLite} to
+ * the output stream. This helper method avoids allocation of a {@link MapEntryLite} built with a
+ * key and value and is called from generated code directly.
*/
public void serializeTo(CodedOutputStream output, int fieldNumber, K key, V value)
throws IOException {
@@ -149,9 +149,9 @@ public class MapEntryLite<K, V> {
}
/**
- * Computes the message size for the provided key and value as though they were wrapped
- * by a {@link MapEntryLite}. This helper method avoids allocation of a {@link MapEntryLite}
- * built with a key and value and is called from generated code directly.
+ * Computes the message size for the provided key and value as though they were wrapped by a
+ * {@link MapEntryLite}. This helper method avoids allocation of a {@link MapEntryLite} built with
+ * a key and value and is called from generated code directly.
*/
public int computeMessageSize(int fieldNumber, K key, V value) {
return CodedOutputStream.computeTagSize(fieldNumber)
@@ -160,8 +160,8 @@ public class MapEntryLite<K, V> {
}
/**
- * Parses an entry off of the input as a {@link Map.Entry}. This helper requires an allocation
- * so using {@link #parseInto} is preferred if possible.
+ * Parses an entry off of the input as a {@link Map.Entry}. This helper requires an allocation so
+ * using {@link #parseInto} is preferred if possible.
*/
public Map.Entry<K, V> parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry)
throws IOException {
@@ -170,7 +170,7 @@ public class MapEntryLite<K, V> {
static <K, V> Map.Entry<K, V> parseEntry(
CodedInputStream input, Metadata<K, V> metadata, ExtensionRegistryLite extensionRegistry)
- throws IOException{
+ throws IOException {
K key = metadata.defaultKey;
V value = metadata.defaultValue;
while (true) {
@@ -192,12 +192,12 @@ public class MapEntryLite<K, V> {
}
/**
- * Parses an entry off of the input into the map. This helper avoids allocaton of a
- * {@link MapEntryLite} by parsing directly into the provided {@link MapFieldLite}.
+ * Parses an entry off of the input into the map. This helper avoids allocaton of a {@link
+ * MapEntryLite} by parsing directly into the provided {@link MapFieldLite}.
*/
public void parseInto(
MapFieldLite<K, V> map, CodedInputStream input, ExtensionRegistryLite extensionRegistry)
- throws IOException {
+ throws IOException {
int length = input.readRawVarint32();
final int oldLimit = input.pushLimit(length);
K key = metadata.defaultKey;