|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||
java.lang.Objectjava.lang.Enum<FieldValidator>
com.atlassian.fisheye.util.FieldValidator
public enum FieldValidator
Utility class for validating field. All validation methods throw an IllegalArgumentException if
the provided value does not pass validation.
| Enum Constant Summary | |
|---|---|
INSTANCE
|
|
| Method Summary | |
|---|---|
void |
notBlank(java.lang.String fieldname,
java.lang.String value)
Validates that value is not blank |
void |
positive(java.lang.String fieldname,
java.lang.Float value)
Validates that value is not positive |
void |
positive(java.lang.String fieldname,
java.lang.Integer value)
Validates that value is positive |
void |
positive(java.lang.String fieldname,
java.lang.Long value)
Validates that value is positive |
void |
validTimeString(java.lang.String fieldname,
java.lang.String timeString)
Validates that value is a valid time string. |
static FieldValidator |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static FieldValidator[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final FieldValidator INSTANCE
| Method Detail |
|---|
public static FieldValidator[] values()
for (FieldValidator c : FieldValidator.values()) System.out.println(c);
public static FieldValidator valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
java.lang.NullPointerException - if the argument is null
public void notBlank(java.lang.String fieldname,
java.lang.String value)
value is not blank
fieldname - the name of the field that is validated. This is used in the exception message.value - the value to validate
public void positive(java.lang.String fieldname,
java.lang.Integer value)
value is positive
fieldname - the name of the field that is validated. This is used in the exception message.value - the value to validate
public void positive(java.lang.String fieldname,
java.lang.Float value)
value is not positive
fieldname - the name of the field that is validated. This is used in the exception message.value - the value to validate
public void positive(java.lang.String fieldname,
java.lang.Long value)
value is positive
fieldname - the name of the field that is validated. This is used in the exception message.value - the value to validate
public void validTimeString(java.lang.String fieldname,
java.lang.String timeString)
value is a valid time string. A valid time string is a number followed by the unit of time. The following units can be used:
s|second|seconds|mi|minute|minutes|h|hour|hours|d|day|days|w|week|weeks|mo|month|months|y|year|years
fieldname - the name of the field that is validated. This is used in the exception message.timeString - the value to validate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||