Files
alfresco-community-repo/source/java/org/alfresco/util/JodCoordinationBoolean.java
Raluca Munteanu 86dc6f3402 Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2)
125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@125603 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2016-04-20 10:21:07 +00:00

44 lines
1.2 KiB
Java

package org.alfresco.util;
import org.alfresco.util.bean.BooleanBean;
/**
* Wraps a {@link org.alfresco.util.JodCoordination} object to return one of its boolean methods,
* so that it may be used as the input to another bean.
*
* @author Alan Davis
*/
public class JodCoordinationBoolean implements BooleanBean
{
private JodCoordination jodCoordination;
private String returnValue;
public void setJodCoordination(JodCoordination jodCoordination)
{
this.jodCoordination = jodCoordination;
}
public void setReturnValue(String returnValue)
{
this.returnValue = returnValue;
}
@Override
public boolean isTrue()
{
if ("startOpenOffice".equals(returnValue))
{
return jodCoordination.startOpenOffice();
}
else if ("startListener".equals(returnValue))
{
return jodCoordination.startListener();
}
else
{
throw new IllegalArgumentException("Expected \"startOpenOffice\" or \"startListener\" " +
"as the returnValue property, but it was \""+returnValue+"\"");
}
}
}