You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2017/07/18 17:21:41 UTC
[3/4] geode git commit: GEODE-3141: spotless reformatting
GEODE-3141: spotless reformatting
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/40e70f18
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/40e70f18
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/40e70f18
Branch: refs/heads/develop
Commit: 40e70f18d3f7233cb7475edc2cc08f423dd9d422
Parents: 66468b1
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Fri Jul 14 13:06:17 2017 -0700
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Tue Jul 18 10:20:31 2017 -0700
----------------------------------------------------------------------
.../protobuf/utilities/ProtobufUtilities.java | 38 ++++++++++++--------
1 file changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/40e70f18/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java b/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java
index 02afc88..0f2628c 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/utilities/ProtobufUtilities.java
@@ -31,21 +31,22 @@ import org.apache.geode.serialization.registry.exception.CodecNotRegisteredForTy
* mainly focused on helper functions which can be used in building BasicTypes for use in other
* messages or those used to create the top level Message objects.
*
- * Helper functions specific to creating ClientProtocol.Responses can be found at {@link
- * ProtobufResponseUtilities} Helper functions specific to creating ClientProtocol.Requests can be
- * found at {@link ProtobufRequestUtilities}
+ * Helper functions specific to creating ClientProtocol.Responses can be found at
+ * {@link ProtobufResponseUtilities} Helper functions specific to creating ClientProtocol.Requests
+ * can be found at {@link ProtobufRequestUtilities}
*/
public abstract class ProtobufUtilities {
/**
* Creates a object containing the type and value encoding of a piece of data
+ *
* @param serializationService - object which knows how to encode objects for the protobuf
- * protocol {@link ProtobufSerializationService}
+ * protocol {@link ProtobufSerializationService}
* @param unencodedValue - the value object which is to be encoded
* @return a protobuf EncodedValue object
* @throws UnsupportedEncodingTypeException - The object passed doesn't have a corresponding
- * SerializationType
+ * SerializationType
* @throws CodecNotRegisteredForTypeException - There isn't a protobuf codec for the
- * SerializationType of the passed object
+ * SerializationType of the passed object
*/
public static BasicTypes.EncodedValue createEncodedValue(
SerializationService serializationService, Object unencodedValue)
@@ -59,29 +60,31 @@ public abstract class ProtobufUtilities {
/**
* Creates a protobuf key,value pair from an encoded key and value
+ *
* @param key - an EncodedValue containing the key of the entry
* @param value - an EncodedValue containing the value of the entry
* @return a protobuf Entry object containing the passed key and value
*/
public static BasicTypes.Entry createEntry(BasicTypes.EncodedValue key,
- BasicTypes.EncodedValue value) {
+ BasicTypes.EncodedValue value) {
return BasicTypes.Entry.newBuilder().setKey(key).setValue(value).build();
}
/**
* Creates a protobuf key,value pair from unencoded data
+ *
* @param serializationService - object which knows how to encode objects for the protobuf
- * protocol {@link ProtobufSerializationService}
+ * protocol {@link ProtobufSerializationService}
* @param unencodedKey - the unencoded key for the entry
* @param unencodedValue - the unencoded value for the entry
* @return a protobuf Entry containing the encoded key and value
* @throws UnsupportedEncodingTypeException - The key or value passed doesn't have a corresponding
- * SerializationType
+ * SerializationType
* @throws CodecNotRegisteredForTypeException - There isn't a protobuf codec for the
- * SerializationType of the passed key or value
+ * SerializationType of the passed key or value
*/
public static BasicTypes.Entry createEntry(SerializationService serializationService,
- Object unencodedKey, Object unencodedValue)
+ Object unencodedKey, Object unencodedValue)
throws UnsupportedEncodingTypeException, CodecNotRegisteredForTypeException {
return createEntry(createEncodedValue(serializationService, unencodedKey),
createEncodedValue(serializationService, unencodedValue));
@@ -89,6 +92,7 @@ public abstract class ProtobufUtilities {
/**
* This creates a protobuf message containing a ClientProtocol.Response
+ *
* @param messageHeader - The header for the message
* @param response - The response for the message
* @return a protobuf Message containing the above parameters
@@ -101,6 +105,7 @@ public abstract class ProtobufUtilities {
/**
* This creates a protobuf message containing a ClientProtocol.Request
+ *
* @param messageHeader - The header for the message
* @param request - The request for the message
* @return a protobuf Message containing the above parameters
@@ -113,6 +118,7 @@ public abstract class ProtobufUtilities {
/**
* This builds the MessageHeader for a response which matches an incoming request
+ *
* @param request - The request message that we're responding to.
* @return the MessageHeader the response to the passed request
*/
@@ -123,6 +129,7 @@ public abstract class ProtobufUtilities {
/**
* This creates a MessageHeader
+ *
* @param correlationId - An identifier used to correlate requests and responses
* @return a MessageHeader containing the above parameters
*/
@@ -132,17 +139,18 @@ public abstract class ProtobufUtilities {
/**
* This will return the object encoded in a protobuf EncodedValue
+ *
* @param serializationService - object which knows how to encode objects for the protobuf
- * protocol {@link ProtobufSerializationService}
+ * protocol {@link ProtobufSerializationService}
* @param encodedValue - The value to be decoded
* @return the object encoded in the passed encodedValue
* @throws UnsupportedEncodingTypeException - There isn't a SerializationType matching the
- * encodedValues type
+ * encodedValues type
* @throws CodecNotRegisteredForTypeException - There isn't a protobuf codec for the
- * SerializationType matching the encodedValues type
+ * SerializationType matching the encodedValues type
*/
public static Object decodeValue(SerializationService serializationService,
- BasicTypes.EncodedValue encodedValue)
+ BasicTypes.EncodedValue encodedValue)
throws UnsupportedEncodingTypeException, CodecNotRegisteredForTypeException {
BasicTypes.EncodingType encoding = encodedValue.getEncodingType();
byte[] bytes = encodedValue.getValue().toByteArray();