Formatted and cleaned up sources
This commit is contained in:
parent
50425fd263
commit
532ff8e6fe
4 changed files with 14 additions and 8 deletions
|
@ -7,7 +7,7 @@ public final class Alternatives {
|
|||
|
||||
/**
|
||||
* Returns the first object that is not null
|
||||
*
|
||||
*
|
||||
* @param objects The objects to process
|
||||
* @return The first value that is not null. null when there is no not-null value
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@ public final class Integers {
|
|||
|
||||
/**
|
||||
* Converts a String into an Integer.
|
||||
*
|
||||
*
|
||||
* @param s The String to convert, may be null
|
||||
* @return The parsed Integer or null when parsing is not possible
|
||||
*/
|
||||
|
|
|
@ -69,11 +69,13 @@ public final class Lists {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks whether the list has the given size. A null list is treated like a list without entries.
|
||||
* Checks whether the list has the given size. A null list is treated like a list without
|
||||
* entries.
|
||||
*
|
||||
* @param list The list to check
|
||||
* @param size The size to check
|
||||
* @return true when the list has the given size or when size = 0 and the list is null, false otherwise
|
||||
* @return true when the list has the given size or when size = 0 and the list is null, false
|
||||
* otherwise
|
||||
*/
|
||||
public static boolean sizeIs(final List<?> list, final int size) {
|
||||
if (size == 0) {
|
||||
|
|
|
@ -62,10 +62,12 @@ public final class Strings {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes the whitespace at the beginning and end of a String. When the String only contains whitespace, it returns null.
|
||||
* Removes the whitespace at the beginning and end of a String. When the String only contains
|
||||
* whitespace, it returns null.
|
||||
*
|
||||
* @param s The String to trim, may be null
|
||||
* @return null when the input String is null or does only contain whitespace, the trimmed String otherwise
|
||||
* @return null when the input String is null or does only contain whitespace, the trimmed
|
||||
* String otherwise
|
||||
*/
|
||||
public static String trimToNull(final String s) {
|
||||
final String trimmed = trim(s);
|
||||
|
@ -77,10 +79,12 @@ public final class Strings {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes the whitespace at the beginning and end of a String. When the String only contains whitespace, it returns null.
|
||||
* Removes the whitespace at the beginning and end of a String. When the String only contains
|
||||
* whitespace, it returns null.
|
||||
*
|
||||
* @param s The String to trim, may be null
|
||||
* @return null when the input String is null or does only contain whitespace, the trimmed String otherwise
|
||||
* @return null when the input String is null or does only contain whitespace, the trimmed
|
||||
* String otherwise
|
||||
*/
|
||||
public static String trimToEmpty(final String s) {
|
||||
final String trimmed = trim(s);
|
||||
|
|
Loading…
Reference in a new issue