Package net.sf.basedb.util.encode
Class EncodeUtil
- java.lang.Object
-
- net.sf.basedb.util.encode.EncodeUtil
-
public class EncodeUtil extends Object
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
Constructors Constructor Description EncodeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>
decodeAll(Collection<String> values, EncoderDecoder decoder)
Decode all strings in a collection.static List<String>
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.
-
-
-
Method Detail
-
encodeAll
public static List<String> encodeAll(Collection<String> values, EncoderDecoder encoder)
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
public static List<String> decodeAll(Collection<String> values, EncoderDecoder decoder)
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
-
-