|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| StartsWithConstraint.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | package com.agical.rmock.core.match.constraint; | |
| 2 | ||
| 3 | import com.agical.rmock.core.match.Constraint; | |
| 4 | ||
| 5 | /** | |
| 6 | * @author brolund | |
| 7 | * | |
| 8 | * (c) 2005 Agical AB | |
| 9 | */ | |
| 10 | public class StartsWithConstraint extends AbstractConstraint implements | |
| 11 | Constraint { | |
| 12 | /** | |
| 13 | * @param name | |
| 14 | * @param reference | |
| 15 | */ | |
| 16 | 3 | public StartsWithConstraint(String reference) { |
| 17 | 3 | super("beginsWith", reference); |
| 18 | } | |
| 19 | ||
| 20 | 6 | public boolean passes(Object object) { |
| 21 | 6 | return ((String)object).startsWith( (String)getReference().getObject() ); |
| 22 | } | |
| 23 | ||
| 24 | } |
|
||||||||||