|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jstore.StoreUtil
public class StoreUtil
This class contains static utility methods
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from interface com.jalios.jstore.StoreConstants |
---|
ARRAY_FLAG, CLEANING_STATE, COLLECTION_FLAG, CREATE_OP, DELETE_OP, IDLE_STATE, INNER_LOGS, INNER_MILESTONE, INNER_PREFIX, INNER_SYNC, ITEM_ESCAPE_CHAR, ITEM_SEPARATOR, LOADING_STATE, MAP_ASSIGN, MAP_CHARS_TO_ESCAPE, MAP_CLASS_SEPARATOR, MAP_FLAG, NAMESPACE, SH_SUFFIX, STORING_STATE, UPDATE_OP |
Constructor Summary | |
---|---|
StoreUtil()
|
Method Summary | |
---|---|
static boolean |
checkUrid(String urid)
Checks if the given urid is valid |
static ArrayList<?> |
decodeArrayList(String listStr,
Store store)
|
static boolean[] |
decodeBooleanArray(String arrayStr)
|
static byte[] |
decodeByteArray(String arrayStr)
|
static char[] |
decodeCharArray(String arrayStr)
|
static Class<?> |
decodeClass(String classStr,
Store store)
|
static Collection<?> |
decodeCollection(String collStr,
Store store,
Collection<Object> coll)
|
static Date |
decodeDate(String dateStr)
|
static double[] |
decodeDoubleArray(String arrayStr)
|
static float[] |
decodeFloatArray(String arrayStr)
|
static HashMap<?,?> |
decodeHashMap(String mapStr,
Store store)
|
static HashSet<?> |
decodeHashSet(String setStr,
Store store)
|
static Hashtable<?,?> |
decodeHashtable(String mapStr,
Store store)
|
static int[] |
decodeIntArray(String arrayStr)
|
static LinkedHashMap<?,?> |
decodeLinkedHashMap(String mapStr,
Store store)
|
static LinkedList<?> |
decodeLinkedList(String listStr,
Store store)
|
static long[] |
decodeLongArray(String arrayStr)
|
static Map<?,?> |
decodeMap(String mapStr,
Store store,
Map<Object,Object> map)
|
static Object |
decodeObject(Class<?> clazz,
String objStr,
Store store)
Generic object decoder |
static Object[] |
decodeObjectArray(String arrayStr,
Class<?> componentType,
Store store)
|
static Properties |
decodeProperties(String propertiesStr)
|
static short[] |
decodeShortArray(String arrayStr)
|
static Storable |
decodeStorable(String id,
Store store)
|
static TreeMap<?,?> |
decodeTreeMap(String mapStr,
Store store)
|
static TreeSet<?> |
decodeTreeSet(String setStr,
Store store)
|
static Vector<?> |
decodeVector(String vectorStr,
Store store)
|
static String |
encodeArrayList(ArrayList<?> list,
Store store)
|
static String |
encodeBooleanArray(boolean[] array)
|
static String |
encodeByteArray(byte[] array)
|
static String |
encodeCharArray(char[] array)
|
static String |
encodeClass(Class<?> clazz)
|
static String |
encodeCollection(Collection<?> coll,
Store store)
|
static String |
encodeDate(Date date)
|
static String |
encodeDoubleArray(double[] array)
|
static String |
encodeFloatArray(float[] array)
|
static String |
encodeHashMap(HashMap<?,?> map,
Store store)
|
static String |
encodeHashSet(HashSet<?> set,
Store store)
|
static String |
encodeHashtable(Hashtable<?,?> map,
Store store)
|
static String |
encodeIntArray(int[] array)
|
static String |
encodeLinkedHashMap(LinkedHashMap<?,?> map,
Store store)
|
static String |
encodeLinkedList(LinkedList<?> list,
Store store)
|
static String |
encodeLongArray(long[] array)
|
static String |
encodeMap(Map<?,?> map,
Store store)
|
static String |
encodeObject(Object obj,
Store store)
Generic object encoder |
static String |
encodeObjectArray(Object[] array,
Store store)
|
static String |
encodeProperties(Properties properties)
|
static String |
encodeShortArray(short[] array)
|
static String |
encodeStorable(Storable storable,
Store store)
|
static String |
encodeTreeMap(TreeMap<?,?> map,
Store store)
|
static String |
encodeTreeSet(TreeSet<?> set,
Store store)
|
static String |
encodeVector(Vector<?> vector,
Store store)
|
static String |
generateUrid()
Generates an URID based on the local hostname |
static Field |
getField(Class<?> clazz,
String attName)
Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object. |
static Object |
getFieldValue(Object instance,
Field field)
|
static String |
getGetterMethodName(Field field)
|
static String |
getSetterMethodName(Field field)
|
static void |
main(String[] args)
|
static void |
setFieldValue(Storable storable,
Field field,
Object fieldValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public StoreUtil()
Method Detail |
---|
public static String generateUrid()
public static boolean checkUrid(String urid)
urid
- the urid to be checked
public static void main(String[] args)
public static String getGetterMethodName(Field field)
ReflectUtil.getGetterMethodName(Field)
public static String getSetterMethodName(Field field)
ReflectUtil.getSetterMethodName(Field)
public static Field getField(Class<?> clazz, String attName)
clazz
- specifies the class or interfaceattName
- the name of the desired fieldpublic static Object getFieldValue(Object instance, Field field)
ReflectUtil.getFieldValue(Object, Field)
public static void setFieldValue(Storable storable, Field field, Object fieldValue)
ReflectUtil.setFieldValue(Object, Field, Object)
public static String encodeObject(Object obj, Store store)
obj
- the object to encodestore
- the Store (use to swizzle Storable)
public static Object decodeObject(Class<?> clazz, String objStr, Store store)
clazz
- the object's class to decodeobjStr
- the encoding representation of the objectstore
- the Store (use to unswizzle Storable)
public static String encodeBooleanArray(boolean[] array)
public static boolean[] decodeBooleanArray(String arrayStr)
public static String encodeByteArray(byte[] array)
public static byte[] decodeByteArray(String arrayStr)
public static String encodeCharArray(char[] array)
public static char[] decodeCharArray(String arrayStr)
public static String encodeDoubleArray(double[] array)
public static double[] decodeDoubleArray(String arrayStr)
public static String encodeFloatArray(float[] array)
public static float[] decodeFloatArray(String arrayStr)
public static String encodeIntArray(int[] array)
public static int[] decodeIntArray(String arrayStr)
public static String encodeLongArray(long[] array)
public static long[] decodeLongArray(String arrayStr)
public static String encodeShortArray(short[] array)
public static short[] decodeShortArray(String arrayStr)
public static String encodeObjectArray(Object[] array, Store store)
public static Object[] decodeObjectArray(String arrayStr, Class<?> componentType, Store store)
public static String encodeStorable(Storable storable, Store store)
public static Storable decodeStorable(String id, Store store)
public static String encodeDate(Date date)
public static Date decodeDate(String dateStr)
public static String encodeClass(Class<?> clazz)
public static Class<?> decodeClass(String classStr, Store store)
public static String encodeProperties(Properties properties)
public static Properties decodeProperties(String propertiesStr)
public static String encodeCollection(Collection<?> coll, Store store)
public static Collection<?> decodeCollection(String collStr, Store store, Collection<Object> coll)
public static String encodeArrayList(ArrayList<?> list, Store store)
public static ArrayList<?> decodeArrayList(String listStr, Store store)
public static String encodeLinkedList(LinkedList<?> list, Store store)
public static LinkedList<?> decodeLinkedList(String listStr, Store store)
public static String encodeVector(Vector<?> vector, Store store)
public static Vector<?> decodeVector(String vectorStr, Store store)
public static String encodeHashSet(HashSet<?> set, Store store)
public static HashSet<?> decodeHashSet(String setStr, Store store)
public static String encodeTreeSet(TreeSet<?> set, Store store)
public static TreeSet<?> decodeTreeSet(String setStr, Store store)
public static String encodeMap(Map<?,?> map, Store store)
public static Map<?,?> decodeMap(String mapStr, Store store, Map<Object,Object> map)
public static String encodeLinkedHashMap(LinkedHashMap<?,?> map, Store store)
public static LinkedHashMap<?,?> decodeLinkedHashMap(String mapStr, Store store)
public static String encodeHashMap(HashMap<?,?> map, Store store)
public static HashMap<?,?> decodeHashMap(String mapStr, Store store)
public static String encodeHashtable(Hashtable<?,?> map, Store store)
public static Hashtable<?,?> decodeHashtable(String mapStr, Store store)
public static String encodeTreeMap(TreeMap<?,?> map, Store store)
public static TreeMap<?,?> decodeTreeMap(String mapStr, Store store)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |