Equals (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.condition, class: Equals

# Class Equals

java.lang.Object
org.apache.tools.ant.taskdefs.condition.Equals

All Implemented Interfaces:
  `Condition`

public class Equals extends Object implements Condition
Simple comparison condition.

Since:
  Ant 1.4

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Equals()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `eval()`
  Is this condition true?
  `void`
  `setArg1(Object arg1)`
  Set the first argument
  `void`
  `setArg1(String arg1)`
  Set the first string
  `void`
  `setArg2(Object arg2)`
  Set the second argument
  `void`
  `setArg2(String arg2)`
  Set the second string
  `void`
  `setCasesensitive(boolean b)`
  Should the comparison be case sensitive?
  `void`
  `setForcestring(boolean forcestring)`
  Set whether to force string comparisons for non-equal, non-string objects.
  `void`
  `setTrim(boolean b)`
  Should we want to trim the arguments before comparing them?

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Equals

    public Equals()

- ## Method Details

  - ### setArg1

    public void setArg1(Object arg1)
    Set the first argument
    Parameters:
      `arg1` - the first argument.
    Since:
      Ant 1.8

  - ### setArg1

    public void setArg1(String arg1)
    Set the first string
    Parameters:
      `arg1` - the first string

  - ### setArg2

    public void setArg2(Object arg2)
    Set the second argument
    Parameters:
      `arg2` - the second argument.
    Since:
      Ant 1.8

  - ### setArg2

    public void setArg2(String arg2)
    Set the second string
    Parameters:
      `arg2` - the second string

  - ### 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

  - ### 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

  - ### setForcestring

    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` - value to set
    Since:
      Ant 1.8.1

  - ### eval

    public boolean eval() throws BuildException
    Description copied from interface: `Condition`
    Is this condition true?
    Specified by:
      `eval` in interface `Condition`
    Returns:
      true if the two strings are equal
    Throws:
      `BuildException` - if the attributes are not set correctly