Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 3247 invoked from network); 4 Jun 2002 21:40:44 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 4 Jun 2002 21:40:44 -0000 Received: (qmail 11880 invoked by uid 97); 4 Jun 2002 21:40:43 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 11751 invoked by uid 97); 4 Jun 2002 21:40:42 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 11530 invoked by uid 97); 4 Jun 2002 21:40:39 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 4 Jun 2002 12:34:20 -0000 Message-ID: <20020604123420.73363.qmail@icarus.apache.org> From: adammurdoch@apache.org To: jakarta-ant-myrmidon-cvs@apache.org Subject: cvs commit: jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/conditions Equals.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N adammurdoch 2002/06/04 05:34:20 Added: framework/src/java/org/apache/myrmidon/framework/conditions Equals.java Removed: antlib/src/java/org/apache/antlib/core Equals.java Log: Move condition across to framework, so that the framework unit tests can use it. Also made it work with Object, rather than String. Revision Changes Path 1.1 jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/conditions/Equals.java Index: Equals.java =================================================================== package org.apache.myrmidon.framework.conditions; /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ import org.apache.myrmidon.api.TaskException; import org.apache.myrmidon.api.TaskContext; import org.apache.myrmidon.framework.conditions.Condition; /** * Simple String comparison condition. * * @author Stefan Bodewig * @version $Revision: 1.1 $ * * @ant.type type="condition" name="equals" */ public class Equals implements Condition { private Object m_arg1; private Object m_arg2; /** * The value to test. */ public void setArg1( final Object a1 ) { m_arg1 = a1; } /** * The value to test. */ public void setArg2( final Object a2 ) { m_arg2 = a2; } /** * Evaluates this condition. * * @param context * The context to evaluate the condition in. */ public boolean evaluate( final TaskContext context ) throws TaskException { if( m_arg1 == null || m_arg2 == null ) { throw new TaskException( "Both arg1 and arg2 are required in equals" ); } return m_arg1.equals( m_arg2 ); } } -- To unsubscribe, e-mail: For additional commands, e-mail: