Constructor and Description |
---|
C() |
Modifier and Type | Method and Description |
---|---|
static fc.util.C.Entry |
e(Object key,
Object val)
Create a map entry to pass to the map method.
|
static fc.util.C.Entry |
entry(Object key,
Object val)
Alias for the e method
|
static List |
list(Object... args)
Create an return a list from the specified args.
|
static void |
main(String[] args) |
static Map |
map(fc.util.C.Entry... entries)
Create an return a Map from the specified args.
|
static Map |
map(Object... objects)
Create an return a Map from the specified args, which are treated as key, value pairs in sequence.
|
static boolean |
nullOrEmpty(Collection c)
Returns true if the specified collection is null or empty.
|
static Set |
randomNNoDuplicates(List list,
int count)
Pick NON-duplicate N random items from a list.
|
static Set |
randomNNoDuplicates(List list,
int count,
int retries)
Pick NON-duplicate N random items from a list.
|
static Set |
randomNNoDups(List list,
int count)
alias for the
randomNNoDuplicates(List, int) method |
static Set |
set(Object... args)
Create an return a Set from the specified args.
|
static boolean |
unbox(Boolean b)
unbox and return false if null
|
static char |
unbox(Character c)
unbox and return '0' if null
|
static double |
unbox(Double d)
unbox and return 0 if null
|
static int |
unbox(Integer i)
unbox and return 0 if null
|
static long |
unbox(Long l)
unbox and return 0 if null
|
static short |
unbox(Short s)
unbox and return 0 if null
|
static boolean |
unboxBool(Object b)
unbox and return false if null
|
static boolean |
unboxBoolean(Object b)
unbox and return false if null
|
static char |
unboxChar(Object c)
unbox and return '0' if null
|
static double |
unboxDouble(Object d)
unbox and return 0 if null
|
static int |
unboxInt(Object i)
unbox and return 0 if null
|
static long |
unboxLong(Object i)
unbox and return 0 if null
|
static short |
unboxShort(Object s)
unbox and return 0 if null
|
public C()
public static Map map(Object... objects)
Map map = map("a", "hello", "b", 123, "c", new int[] {4,5,6});
public static Map map(fc.util.C.Entry... entries)
Map map = map(e("a", "hello"), e("b", 123));
public static fc.util.C.Entry e(Object key, Object val)
public static Set randomNNoDuplicates(List list, int count) throws IllegalArgumentException
count
- number (N) items to choose.IllegalArgumentException
public static Set randomNNoDups(List list, int count) throws IllegalArgumentException
randomNNoDuplicates(List, int)
methodIllegalArgumentException
public static Set randomNNoDuplicates(List list, int count, int retries) throws IllegalArgumentException
count
- number (N) items to choose.retries
- number of retries to get a unique random item before bailing/throwing an ExceptionIllegalArgumentException
public static short unboxShort(Object s)
public static double unboxDouble(Object d)
public static boolean unboxBoolean(Object b)
public static boolean nullOrEmpty(Collection c)