org.apache.tools.ant.taskdefs.condition

Class Equals

Implemented Interfaces:
Condition

public class Equals
extends java.lang.Object
implements Condition

Simple String comparison condition.

Version:
$Revision: 1.10.2.4 $

Since:
Ant 1.4

Method Summary

boolean
eval()
void
setArg1(String a1)
Set the first string
void
setArg2(String a2)
Set the second string
void
setCasesensitive(boolean b)
Should the comparison be case sensitive?
void
setTrim(boolean b)
Should we want to trim the arguments before comparing them?

Method Details

eval

public boolean eval()
            throws BuildException
Specified by:
eval in interface Condition

Returns:
true if the two strings are equal

Throws:
BuildException - if the attributes are not set correctly


setArg1

public void setArg1(String a1)
Set the first string

Parameters:
a1 - the first string


setArg2

public void setArg2(String a2)
Set the second string

Parameters:
a2 - the second string


setCasesensitive

public void setCasesensitive(boolean b)
Should the comparison be case sensitive?

Parameters:
b - if true use a case sensitive comparison (this is the default)

Since:
Ant 1.5


setTrim

public void setTrim(boolean b)
Should we want to trim the arguments before comparing them?

Parameters:
b - if true trim the arguments

Since:
Ant 1.5


Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.