From f1700d17e167da53bf9d208ea0190c876c80827d Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 30 Jan 2009 15:24:05 +0000 Subject: [PATCH] FR [ 2430845 ] Add ProcessInfoParameter.getParameterAsBoolean method https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2430845&group_id=176962 --- .../process/ProcessInfoParameter.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/base/src/org/compiere/process/ProcessInfoParameter.java b/base/src/org/compiere/process/ProcessInfoParameter.java index 68e2145449..26c8f19263 100644 --- a/base/src/org/compiere/process/ProcessInfoParameter.java +++ b/base/src/org/compiere/process/ProcessInfoParameter.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * + * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * @@ -25,6 +25,9 @@ import java.math.BigDecimal; * * @author Jorg Janke * @version $Id: ProcessInfoParameter.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + * + * @author Teo Sarca, www.arhipac.ro + *
  • FR [ 2430845 ] Add ProcessInfoParameter.getParameterAsBoolean method */ public class ProcessInfoParameter implements Serializable { @@ -112,6 +115,19 @@ public class ProcessInfoParameter implements Serializable BigDecimal bd = new BigDecimal(m_Parameter.toString()); return bd.intValue(); } // getParameterAsInt + + /** + * Method getParameter as Boolean + * @return boolean value + */ + public boolean getParameterAsBoolean () + { + if (m_Parameter == null) + return false; + if (m_Parameter instanceof Boolean) + return ((Boolean)m_Parameter).booleanValue(); + return "Y".equals(m_Parameter); + } /** * Method getParameter_To @@ -135,6 +151,19 @@ public class ProcessInfoParameter implements Serializable BigDecimal bd = new BigDecimal(m_Parameter_To.toString()); return bd.intValue(); } // getParameter_ToAsInt + + /** + * Method getParameter as Boolean + * @return boolean + */ + public boolean getParameter_ToAsBoolean () + { + if (m_Parameter_To == null) + return false; + if (m_Parameter_To instanceof Boolean) + return ((Boolean)m_Parameter_To).booleanValue(); + return "Y".equals(m_Parameter_To); + } /**