2.17.2: 2011-06-17

net.sf.basedb.util.encode
Class EncodeUtil

java.lang.Object
  extended by 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 (Thu, 30 Sep 2010) $

Constructor Summary
EncodeUtil()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncodeUtil

public EncodeUtil()
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 encoded
encoder - 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 decoded
decoder - 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 encoded
encoder - The encoder implemenation to use
separator - The separator string that is inserted between the decoded values
skipNull - TRUE to skip null values (before and after encoding)
Returns:
A string with the encoded values joined together

2.17.2: 2011-06-17