Package sonia.scm.util
Class Util
java.lang.Object
sonia.scm.util.Util
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable>
intcompare(T object, T otherObject) static <T> booleancontainsOne(Collection<T> collection, Collection<T> other) static StringconvertTime(long time) static longconvertTime(String timeString) static <T> Collection<T>createSubCollection(Collection<T> values, int start, int limit) static <T> Collection<T>createSubCollection(Collection<T> values, Comparator<T> comparator, int start, int limit) static <T> Collection<T>createSubCollection(Collection<T> values, Comparator<T> comparator, CollectionAppender<T> appender, int start, int limit) static <T> Collection<T>createSubCollection(Collection<T> values, CollectionAppender<T> appender, int start, int limit) static StringformatDate(Date date) static StringformatDate(Date date, TimeZone tz) static byte[]fromHexString(String value) static <K,V> V getFirst(com.google.common.collect.Multimap<K, V> map, K key) Returns the first value of aMultimapornull.static <T> Tstatic <T> Tstatic booleanstatic booleanstatic booleanisEmpty(Collection<?> collection) static booleanstatic booleanstatic booleanisNotEmpty(Object[] array) static booleanisNotEmpty(String value) static booleanisNotEmpty(Collection<?> collection) static booleanisNotEmpty(Map<?, ?> map) static booleanisNotEquals(Object object, Object other) static StringReturns an emtpy string, if the object is null.static StringReturns an empty string, if the string is null.static Datestatic Datestatic booleanstartWithIgnoreCase(String value, String start) static StringtoString(byte[] byteValue) static StringtoString(Collection<? extends Object> collection)
-
Field Details
-
DATE_PATTERN
- See Also:
-
EMPTY_STRING
- See Also:
-
-
Method Details
-
compare
-
containsOne
-
convertTime
-
convertTime
-
createSubCollection
public static <T> Collection<T> createSubCollection(Collection<T> values, Comparator<T> comparator, int start, int limit) - Since:
- 1.4
-
createSubCollection
- Since:
- 1.4
-
createSubCollection
public static <T> Collection<T> createSubCollection(Collection<T> values, CollectionAppender<T> appender, int start, int limit) - Since:
- 1.4
-
createSubCollection
public static <T> Collection<T> createSubCollection(Collection<T> values, Comparator<T> comparator, CollectionAppender<T> appender, int start, int limit) - Since:
- 1.4
-
formatDate
-
formatDate
-
fromHexString
-
nonNull
Returns an emtpy string, if the object is null. Otherwise, the result of the toString method of the object is returned.- Parameters:
value- object- Returns:
- string value or empty string
- Since:
- 1.13
-
nonNull
Returns an empty string, if the string is null. Otherwise, the string is returned. The method is available to fix a possible linkage error which was introduced with version 1.14. Please have a look at: https://bitbucket.org/sdorra/scm-manager/issue/569/active-directory-plugin-not-working-in- Parameters:
value- string value- Returns:
- string value or empty string
- Since:
- 1.38
-
parseDate
- Throws:
ParseException
-
parseDate
- Throws:
ParseException
-
getFirst
public static <K,V> V getFirst(com.google.common.collect.Multimap<K, V> map, K key) Returns the first value of aMultimapornull.- Type Parameters:
K- type of keyV- type of- Parameters:
map- multi mapkey- key- Returns:
- first value of
null - Since:
- 2.0.0
-
startWithIgnoreCase
- Since:
- 1.17
-
toString
-
toString
-
getFirst
- Since:
- 1.5
-
getFirst
- Since:
- 1.5
-
isEmpty
-
isEmpty
-
isEmpty
-
isEmpty
-
isEquals
-
isNotEmpty
-
isNotEmpty
-
isNotEmpty
-
isNotEmpty
-
isNotEquals
-