FR [ 2818369 ] Implement PO.get_ValueAs*(columnName)

https://sourceforge.net/tracker/?func=detail&aid=2818369&group_id=176962&atid=879335
This commit is contained in:
teo_sarca 2009-07-08 06:39:15 +00:00
parent e930ee3960
commit 74ea49206b
1 changed files with 34 additions and 0 deletions

View File

@ -71,6 +71,8 @@ import org.w3c.dom.Element;
* <li>FR [ 1720995 ] Add PO.saveEx() and PO.deleteEx() methods * <li>FR [ 1720995 ] Add PO.saveEx() and PO.deleteEx() methods
* <li>BF [ 1990856 ] PO.set_Value* : truncate string more than needed * <li>BF [ 1990856 ] PO.set_Value* : truncate string more than needed
* <li>FR [ 2042844 ] PO.get_Translation improvements * <li>FR [ 2042844 ] PO.get_Translation improvements
* <li>FR [ 2818369 ] Implement PO.get_ValueAs*(columnName)
* https://sourceforge.net/tracker/?func=detail&aid=2818369&group_id=176962&atid=879335
* @author Victor Perez, e-Evolution SC * @author Victor Perez, e-Evolution SC
* <li>[ 2195894 ] Improve performance in PO engine * <li>[ 2195894 ] Improve performance in PO engine
* <li>http://sourceforge.net/tracker/index.php?func=detail&aid=2195894&group_id=176962&atid=879335 * <li>http://sourceforge.net/tracker/index.php?func=detail&aid=2195894&group_id=176962&atid=879335
@ -3834,4 +3836,36 @@ public abstract class PO
line.set_TrxName(trxName); line.set_TrxName(trxName);
} }
/**
* Get Integer Value
* @param columnName
* @return int value
*/
public int get_ValueAsInt (String columnName)
{
int idx = get_ColumnIndex(columnName);
if (idx < 0)
{
return 0;
}
return get_ValueAsInt(idx);
}
/**
* Get value as Boolean
* @param columnName
* @return boolean value
*/
public boolean get_ValueAsBoolean(String columnName)
{
Object oo = get_Value(columnName);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
} // PO } // PO