public class Precondition extends Object
Guava: String foo = checkArgument(!StringUtils.isBlank(foo), "'%s' cannot be blank"); Kuali: String foo = checkNotBlank(foo, "foo");
| Constructor and Description |
|---|
Precondition() |
| Modifier and Type | Method and Description |
|---|---|
static int |
checkMin(int arg,
int min,
String argName)
Check that arg is greater than or equal to min.
|
static long |
checkMin(long arg,
long min,
String argName)
Check that arg is greater than or equal to min.
|
static com.google.common.base.Optional<Integer> |
checkMin(com.google.common.base.Optional<Integer> arg,
int min,
String argName)
If arg.isPresent(), check that the Integer it contains is greater than or equal to min
|
static com.google.common.base.Optional<Long> |
checkMin(com.google.common.base.Optional<Long> arg,
long min,
String argName)
If arg.isPresent(), check that the Long it contains is greater than or equal to min
|
static com.google.common.base.Optional<String> |
checkNotBlank(com.google.common.base.Optional<String> arg,
String argName)
If arg.isPresent(), check that the string it contains is not whitespace, empty ("") or null.
|
static String |
checkNotBlank(String arg,
String argName)
Check that a String is not whitespace, empty ("") or null.
|
public Precondition()
public static String checkNotBlank(String arg, String argName)
public static com.google.common.base.Optional<String> checkNotBlank(com.google.common.base.Optional<String> arg, String argName)
public static com.google.common.base.Optional<Integer> checkMin(com.google.common.base.Optional<Integer> arg, int min, String argName)
public static com.google.common.base.Optional<Long> checkMin(com.google.common.base.Optional<Long> arg, long min, String argName)
public static int checkMin(int arg, int min, String argName)
Copyright © 2010–2014 The Kuali Foundation. All rights reserved.