|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.rules.constraint.Required
public class Required
Validates a required property. Required is defined as non-null and, if the
object is a string, not empty and not blank. If the object is an instance of
Collection
, Map
or an array it will test if it is empty.
Constructor Summary | |
---|---|
Required()
Default constructor which creates a required constraint by using the type required |
|
Required(String type)
Creates a required constraint by using a custom type. |
Method Summary | |
---|---|
String |
getType()
Returns this object's logical type identifier. |
static Required |
instance()
returns the required instance |
static Required |
present()
returns the present instance |
boolean |
test(Object argument)
Tests if this argument is present (non-null, not-empty, not blank) |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Required(String type)
type
- the type of the constraint. see getType()
public Required()
required
Method Detail |
---|
public boolean test(Object argument)
test
in interface Constraint
argument
- the argument value
true
if the condition was satisfied,
false
otherwiseConstraint.test(java.lang.Object)
public static Required instance()
public static Required present()
public String toString()
toString
in class Object
public String getType()
TypeResolvable
getType
in interface TypeResolvable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |