Package net.sf.basedb.util.encode
Class EncodeUtil
java.lang.Object
net.sf.basedb.util.encode.EncodeUtil
Utility functions for encoding/decoding strings.
- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2010-09-30 10:53:05 +0200 (to, 30 sep 2010) $
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecodeAll
(Collection<String> values, EncoderDecoder decoder) Decode all strings in a collection.encodeAll
(Collection<String> values, EncoderDecoder encoder) Encode all strings in a collection.static String
encodeAndJoin
(Collection<String> values, EncoderDecoder encoder, String separator, boolean skipNull) Encode all strings in a collection and join them into a single string.
-
Constructor Details
-
EncodeUtil
public EncodeUtil()
-
-
Method Details
-
encodeAll
Encode all strings in a collection.- Parameters:
values
- A collection with values that should be encodedencoder
- The encoder implemenation to use- Returns:
- A list with the encoded values
-
decodeAll
Decode all strings in a collection.- Parameters:
values
- A collection with values that should be decodeddecoder
- The decoder implemenation to use- Returns:
- A list with the decoded values
-
encodeAndJoin
public static String encodeAndJoin(Collection<String> values, EncoderDecoder encoder, String separator, boolean skipNull) Encode all strings in a collection and join them into a single string.- Parameters:
values
- A collection with values that should be encodedencoder
- The encoder implemenation to useseparator
- The separator string that is inserted between the decoded valuesskipNull
- TRUE to skip null values (before and after encoding)- Returns:
- A string with the encoded values joined together
-