Package net.spy.memcached.util
Class StringUtils
java.lang.Object
net.spy.memcached.util.StringUtils
Utility methods on string objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if a given string is a JSON object.static Stringjoin(Collection<String> chunks, String delimiter) Join a collection of strings together into one.static voidvalidateKey(String key, boolean binary) Check if a given key is valid to transmit.
-
Method Details
-
join
Join a collection of strings together into one.- Parameters:
chunks- the chunks to join.delimiter- the delimiter between the keys.- Returns:
- the fully joined string.
-
isJsonObject
Check if a given string is a JSON object.- Parameters:
s- the input string.- Returns:
- true if it is a JSON object, false otherwise.
-
validateKey
Check if a given key is valid to transmit.- Parameters:
key- the key to check.binary- if binary protocol is used.
-