org.jmock.core.constraint

Class StringContains

Implemented Interfaces:
Constraint, SelfDescribing

public class StringContains
extends Object
implements Constraint

Tests if the argument is a string that contains a substring.

Constructor Summary

StringContains(String substring)

Method Summary

StringBuffer
describeTo(StringBuffer buffer)
boolean
eval(Object o)
Evaluates the constraint for argument o.

Constructor Details

StringContains

public StringContains(String substring)

Method Details

describeTo

public StringBuffer describeTo(StringBuffer buffer)
Specified by:
describeTo in interface SelfDescribing

eval

public boolean eval(Object o)
Evaluates the constraint for argument o.
Specified by:
eval in interface Constraint
Parameters:
o - the object against which the constraint is evaluated.
Returns:
true if o meets the constraint, false if it does not.