|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NodeContract
A NodeContract
establishes what sorts of values can be stored
in a node in the registry. The contract is set at node creation time, and
does not change during the node's lifecycle. (But, from the consumer's
point of view, the node instance at a particular path may change,
and bring with it a new contract.)
Also, contracts are comparable, so that the consumer of node data can provide a contract... if the consumer's contract is equal to, or a subset of, the node's contract, then the consumer is happy. In other words, the consumer wants to know that there is no value that will pass the node's contract, but not the consumer's contract.
Field Summary | |
---|---|
static NodeContract |
BOOLEAN_CONTRACT
A contract that checks that the type of the value is a #java.lang.Boolean . |
static NodeContract |
NULL_CONTRACT
A contract that accepts any change. |
static NodeContract |
NUMBER_CONTRACT
A contract that checks that the type of the value is a #java.lang.Number . |
static NodeContract |
STRING_CONTRACT
A contract that checks that the type of the value is a #java.lang.String . |
Method Summary | |
---|---|
boolean |
accepts(java.lang.Object value)
Determine if the specified value meets this contract. |
java.lang.String |
toString()
The contract implementation should overload toString so
the contract can be displayed to the user in a sane format, for use
in error messages, etc. |
Field Detail |
---|
static final NodeContract STRING_CONTRACT
#java.lang.String
.
static final NodeContract BOOLEAN_CONTRACT
#java.lang.Boolean
.
static final NodeContract NUMBER_CONTRACT
#java.lang.Number
.
static final NodeContract NULL_CONTRACT
Method Detail |
---|
boolean accepts(java.lang.Object value)
value
meets this contract.
value
- the value to check
true
if meets contractjava.lang.String toString()
toString
so
the contract can be displayed to the user in a sane format, for use
in error messages, etc.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |