|
Project Information
Members
Featured
Downloads
Wiki pages
Links
|
Contracts for Java enables you to annotate your code with contracts in the form of preconditions, postconditions and invariants. These contract annotations are
Annotating code with contracts helps you:
Here is a simple example of a Java class annotated with contracts: interface Time {
...
@Ensures({
"result >= 0",
"result <= 23"
})
int getHour();
@Requires({
"h >= 0",
"h <= 23"
})
@Ensures("getHour() == h")
void setHour(int h);
...
}Here is what the contract for setHour regulates.
To use Cofoja you need to do the following two things:
The following provide more information about Cofoja:
|