Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.condition

public Class Equals

extends Object
implements Condition
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.condition.Condition
Imports
org.apache.tools.ant.BuildException

Simple comparison condition.
Since
Ant 1.4

Field Summary

Modifier and TypeField and Description
private Object
private Object
private int
private boolean
private boolean
private static final int
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the two strings are equal
eval
()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Is this condition true?
public void
setArg1(Object
the first argument.
arg1
)

Set the first argument

public void
setArg1(String
the first string
arg1
)

Set the first string

private void
public void
setArg2(Object
the second argument.
arg2
)

Set the second argument

public void
setArg2(String
the second string
arg2
)

Set the second string

private void
public void
setCasesensitive(boolean
if true use a case sensitive comparison (this is the default)
b
)

Should the comparison be case sensitive?

public void
setForcestring(boolean
value to set
forcestring
)

Set whether to force string comparisons for non-equal, non-string objects.

public void
setTrim(boolean
if true trim the arguments
b
)

Should we want to trim the arguments before comparing them?

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arg1back to summary
private Object arg1
arg2back to summary
private Object arg2
argsback to summary
private int args
caseSensitiveback to summary
private boolean caseSensitive
forcestringback to summary
private boolean forcestring
REQUIREDback to summary
private static final int REQUIRED
trimback to summary
private boolean trim

Constructor Detail

Equalsback to summary
public Equals()

Method Detail

evalback to summary
public boolean eval() throws BuildException

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Doc from org.apache.tools.ant.taskdefs.condition.Condition.eval.

Is this condition true?

Returns:boolean

true if the two strings are equal

Exceptions
BuildException:
if the attributes are not set correctly
setArg1back to summary
public void setArg1(Object arg1)

Set the first argument

Parameters
arg1:Object

the first argument.

Since
Ant 1.8
setArg1back to summary
public void setArg1(String arg1)

Set the first string

Parameters
arg1:String

the first string

setArg1Internalback to summary
private void setArg1Internal(Object arg1)
setArg2back to summary
public void setArg2(Object arg2)

Set the second argument

Parameters
arg2:Object

the second argument.

Since
Ant 1.8
setArg2back to summary
public void setArg2(String arg2)

Set the second string

Parameters
arg2:String

the second string

setArg2Internalback to summary
private void setArg2Internal(Object arg2)
setCasesensitiveback to summary
public void setCasesensitive(boolean b)

Should the comparison be case sensitive?

Parameters
b:boolean

if true use a case sensitive comparison (this is the default)

Since
Ant 1.5
setForcestringback to summary
public void setForcestring(boolean forcestring)

Set whether to force string comparisons for non-equal, non-string objects. This allows object properties (legal in Ant 1.8.x+) to be compared as strings.

Parameters
forcestring:boolean

value to set

Since
Ant 1.8.1
setTrimback to summary
public void setTrim(boolean b)

Should we want to trim the arguments before comparing them?

Parameters
b:boolean

if true trim the arguments

Since
Ant 1.5