|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsugar4j.lang.Lang
public class Lang
Extension methods for all classes that reside in java.lang.
| Nested Class Summary | |
|---|---|
static interface |
Lang.PairMethod
Code to run for a pair. |
| Method Summary | ||
|---|---|---|
static String |
capitalize(String s)
Converts the first character of s to uppercase. |
|
static String |
decorate(String s)
Decorates s by appending it's last character. |
|
static
|
findThrowable(Throwable t,
Class<T> throwableClass)
|
|
static
|
forEachPair(Iterable<E> iterable,
Lang.PairMethod method)
Runs the given method for every pair in the given iterator. |
|
static
|
forEachPair(Object[] array,
Lang.PairMethod method)
Runs the given method for every pair in the given array. |
|
static String |
htmlColorize(String code)
htmlColorize with "keyword" css-class and "comment" css-class. |
|
static String |
htmlColorize(String code,
String cssKeywordSpanClass,
String cssCommentSpanClass)
Highlights all keywords/comments in code using the html 'span' tag. |
|
static boolean |
isSet(String s)
Returns whether the given string is not null and not empty. |
|
static
|
list(List<?> list)
Provides an unchecked but typed version of the given list. |
|
static String |
toIdentifier(String name)
Returns a String suitable for use as a Java identifier. |
|
| Method Detail |
|---|
public static <E> void forEachPair(Iterable<E> iterable,
Lang.PairMethod method)
E - Element type of the iteratoriterable - method -
public static <T> void forEachPair(Object[] array,
Lang.PairMethod method)
array - method - public static String capitalize(String s)
s to uppercase.s is empty.
s -
public static String decorate(String s)
s by appending it's last character.s is empty.
s -
public static String toIdentifier(String name)
name -
customer-name to customerName
public static <T> Throwable findThrowable(Throwable t,
Class<T> throwableClass)
public static String htmlColorize(String code,
String cssKeywordSpanClass,
String cssCommentSpanClass)
code - cssKeywordSpanClass - Css class name for the 'span' element to use for keywordscssCommentSpanClass - Css class name for the 'span' element to use for comments
public static boolean isSet(String s)
null and not empty.
s -
true if s is not null and not emptypublic static String htmlColorize(String code)
code -
public static <T> List<T> list(List<?> list)
ClassCastException is likely to occur if
the element's type do not match.
list -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||