public class MiscUtil extends Object
Constructor and Description |
---|
MiscUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> void |
addAllIfNotPresent(List<T> receivingList,
List<T> supplyingList) |
static <T> void |
addIfNotPresent(List<T> receivingList,
T supplyingElement) |
static Boolean |
and(Boolean... operands)
n-ary and that ignores null values.
|
static Date |
asDate(int year,
int month,
int date,
int hrs,
int min,
int sec) |
static Date |
asDate(XMLGregorianCalendar xgc)
Converts an XMLGregorianCalendar to an instance of java.util.Date
|
static Long |
asLong(XMLGregorianCalendar xgc) |
static XMLGregorianCalendar |
asXMLGregorianCalendar(Date date)
Converts a java.util.Date into an instance of XMLGregorianCalendar
|
static XMLGregorianCalendar |
asXMLGregorianCalendar(Long timeInMilis) |
static String |
binaryToHex(byte[] bytes) |
static <T> void |
carthesian(Collection<Collection<T>> dimensions,
Processor<Collection<T>> processor) |
static <K,V> Map<K,V> |
cloneMap(Map<K,V> orig)
Shallow clone
|
static String |
concat(Collection<String> stringCollection) |
static <T> boolean |
contains(T element,
T[] array) |
static void |
copyDirectory(File src,
File dst)
Copy a directory and its contents.
|
static void |
copyFile(File sourceFile,
File destFile) |
static <T> Collection<T> |
createCollection(T... items) |
static boolean |
equals(Object a,
Object b) |
static <T> Collection<T> |
getValuesFromDisplayableValues(Collection<? extends DisplayableValue<T>> disps) |
static String |
getValueWithClass(Object object) |
static boolean |
hasNoValue(Collection<?> collection) |
static byte[] |
hexToBinary(String hex) |
static boolean |
isAllNull(Collection<?> collection) |
static boolean |
isBetween(XMLGregorianCalendar date,
XMLGregorianCalendar start,
XMLGregorianCalendar end) |
static boolean |
isNoValue(Collection<?> collection) |
static <T> boolean |
listEquals(List<T> a,
List<T> b) |
static String |
readFile(File file) |
static List<String> |
splitLines(String string) |
static String |
stripHtmlMarkup(String htmlString) |
static String |
toString(Object o) |
static <T> Collection<T> |
union(Collection<T>... sets) |
static <T> Collection<? extends T> |
unionExtends(Collection<? extends T>... sets) |
static <T> boolean |
unorderedArrayEquals(T[] a,
T[] b) |
static <T> boolean |
unorderedArrayEquals(T[] a,
T[] b,
Comparator<T> comparator)
Only zero vs non-zero value of comparator is important.
|
static boolean |
unorderedCollectionEquals(Collection a,
Collection b) |
static boolean |
unorderedCollectionEquals(Collection a,
Collection b,
Comparator comparator)
Only zero vs non-zero value of comparator is important.
|
static int |
unorderedCollectionHashcode(Collection collection) |
public static <T> Collection<T> union(Collection<T>... sets)
public static <T> Collection<? extends T> unionExtends(Collection<? extends T>... sets)
public static boolean unorderedCollectionEquals(Collection a, Collection b)
public static boolean unorderedCollectionEquals(Collection a, Collection b, Comparator comparator)
public static <T> boolean unorderedArrayEquals(T[] a, T[] b)
public static <T> boolean unorderedArrayEquals(T[] a, T[] b, Comparator<T> comparator)
public static int unorderedCollectionHashcode(Collection collection)
public static String readFile(File file) throws IOException
IOException
public static void copyFile(File sourceFile, File destFile) throws IOException
IOException
public static void copyDirectory(File src, File dst) throws IOException
src
- The name of the directory to copy.dst
- The name of the destination directory.IOException
- If the directory could not be copied.public static <T> Collection<T> createCollection(T... items)
public static XMLGregorianCalendar asXMLGregorianCalendar(Date date)
date
- Instance of java.util.Date or a null referencepublic static XMLGregorianCalendar asXMLGregorianCalendar(Long timeInMilis)
public static Date asDate(XMLGregorianCalendar xgc)
xgc
- Instance of XMLGregorianCalendar or a null referencepublic static Long asLong(XMLGregorianCalendar xgc)
public static Date asDate(int year, int month, int date, int hrs, int min, int sec)
public static <T> void carthesian(Collection<Collection<T>> dimensions, Processor<Collection<T>> processor)
public static String concat(Collection<String> stringCollection)
public static boolean isAllNull(Collection<?> collection)
public static boolean isNoValue(Collection<?> collection)
public static boolean hasNoValue(Collection<?> collection)
public static boolean isBetween(XMLGregorianCalendar date, XMLGregorianCalendar start, XMLGregorianCalendar end)
public static <T> boolean contains(T element, T[] array)
public static <T> Collection<T> getValuesFromDisplayableValues(Collection<? extends DisplayableValue<T>> disps)
public static String binaryToHex(byte[] bytes)
public static byte[] hexToBinary(String hex)
public static <T> void addAllIfNotPresent(List<T> receivingList, List<T> supplyingList)
public static <T> void addIfNotPresent(List<T> receivingList, T supplyingElement)
Copyright © 2016 evolveum. All rights reserved.