public class PepperSerializationHelper extends Object
Modifier and Type | Field and Description |
---|---|
static char |
COLLECTION_SEPARATOR |
static char |
FORCE_SEPARATOR |
protected static org.slf4j.Logger |
LOGGER |
static char |
MAP_ENTRY_SEPARATOR |
static char |
MAP_ENTRY_SEPARATOR_SEMICOLUMN |
static char |
MAP_KEY_VALUE_SEPARATOR |
static com.google.common.base.Splitter.MapSplitter |
MAP_TO_STRING_SPLITTER |
static com.google.common.base.Splitter.MapSplitter |
MAP_TO_STRING_SPLITTER_SEMICOLUMN |
static int |
MAX_CHARS_PER_COLUMN |
protected static com.google.common.base.Function<Object,CharSequence> |
OBJECT_TO_STRING
Deprecated.
|
static char |
PIPE |
Modifier | Constructor and Description |
---|---|
protected |
PepperSerializationHelper() |
protected static final org.slf4j.Logger LOGGER
public static final int MAX_CHARS_PER_COLUMN
public static final char MAP_KEY_VALUE_SEPARATOR
public static final char MAP_ENTRY_SEPARATOR
public static final char MAP_ENTRY_SEPARATOR_SEMICOLUMN
public static final com.google.common.base.Splitter.MapSplitter MAP_TO_STRING_SPLITTER
public static final com.google.common.base.Splitter.MapSplitter MAP_TO_STRING_SPLITTER_SEMICOLUMN
public static final char PIPE
public static final char COLLECTION_SEPARATOR
public static final char FORCE_SEPARATOR
@Deprecated protected static final com.google.common.base.Function<Object,CharSequence> OBJECT_TO_STRING
public static Map<String,Object> convertToMap(CharSequence asString)
asString
- a String with the form key1=value1,key2=value2Map
public static Map<String,String> convertToMapStringString(CharSequence asString)
public static Map<String,List<String>> convertToMapStringListString(String asString)
public static Set<?> convertToSet(CharSequence asString)
public static Set<? extends String> convertToSetString(CharSequence asString)
public static List<Object> convertToList(CharSequence asString)
public static List<String> convertToListString(CharSequence asString)
public static List<Object> convertToList(CharSequence asString, char separator)
public static List<String> convertToListString(CharSequence asString, char separator)
public static Object convertStringToObject(CharSequence charSequence)
charSequence
- @Beta public static <T> Optional<T> safeToObject(Class<? extends T> clazz, String asString)
clazz
- this the Class
of the object instantiated by this methodasString
- some string describing the object to instantiate@Beta public static void appendLineInCSVFile(Path file, Iterable<?> row) throws IOException
file
- row
- IOException
@Beta public static void appendLineInCSVFile(Writer writer, Iterable<?> row) throws IOException
IOException
@Beta public static void rawAppendLineInCSVFile(Writer writer, Iterable<?> row, boolean wrapInQuotes, int maxLength) throws IOException
IOException
@Beta public static void appendLineInCSVFile(FileOutputStream outputFileIS, Iterable<?> row) throws IOException
IOException
public static <T extends Serializable> T fromString(String s) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T extends Serializable> T fromBytes(byte[] data) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T extends Serializable> T fromBytes(ByteBuffer data) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static String toString(InputStream inputStream, Charset charset) throws IOException
inputStream
- the inputStream which which bytes have to be read. It will NOT be closedcharset
- IOException
public static String toString(Serializable o) throws IOException
IOException
public static byte[] toBytes(Serializable o) throws IOException
IOException
public static String toMD5(String input, Charset charset, MessageDigest md)
public static String toSha512(String input, String salt, Charset charset, MessageDigest md)
public static String generateSha512()
Copyright © 2014–2021. All rights reserved.