public class LangHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LangHelper.ListBuilder |
static class |
LangHelper.MapEntry |
static class |
LangHelper.ObjectBuilder |
Constructor and Description |
---|
LangHelper() |
Modifier and Type | Method and Description |
---|---|
static Object |
arrays(Object[] arrays,
int i,
Object defaultValue)
save access to array.
|
static boolean |
asFirst(List list,
Object item)
put item as first of a list
|
static <T> void |
clearWeekReferenceCollection(Collection<WeakReference<T>> col) |
static <K,T> void |
clearWeekReferenceMap(Map<K,WeakReference<T>> map) |
static Map<?,?> |
collectionToMap(Collection<?> col) |
static Integer |
compareNull(Object obj1,
Object obj2)
compare two objects with one of them null.
|
static LangHelper.MapEntry |
entry(String key,
Object value) |
static <E> List<E> |
getModifiableList(List<E> list) |
static LangHelper.ListBuilder |
list() |
static void |
main(String[] args) |
static Map<String,Object> |
obj(LangHelper.MapEntry... props) |
static LangHelper.ObjectBuilder |
object() |
static Map<String,String> |
objStr(LangHelper.MapEntry... props) |
static void |
putAllIfNotExist(Map map1,
Map map2) |
static Object |
smartInstance(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class c)
return the instance of a class.
|
static int |
unsigned(byte b) |
public static Object smartInstance(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Class c) throws Exception
Exception
public static LangHelper.MapEntry entry(String key, Object value)
public static Map<String,Object> obj(LangHelper.MapEntry... props)
public static Map<String,String> objStr(LangHelper.MapEntry... props)
public static LangHelper.ObjectBuilder object()
public static LangHelper.ListBuilder list()
public static final int unsigned(byte b)
public static Object arrays(Object[] arrays, int i, Object defaultValue)
arrays
- i
- index.defaultValue
- public static Map<?,?> collectionToMap(Collection<?> col)
public static boolean asFirst(List list, Object item)
list
- item
- public static void main(String[] args)
public static <T> void clearWeekReferenceCollection(Collection<WeakReference<T>> col)
public static <K,T> void clearWeekReferenceMap(Map<K,WeakReference<T>> map)
Copyright © 2012-2018. All Rights Reserved.