Here you can find the source of tryToStoreAsIntegerBigDecimal(Object ob)
private static BigDecimal tryToStoreAsIntegerBigDecimal(Object ob)
//package com.java2s; /**/* w ww . ja va 2s. c om*/ * ***************************************************************************** * Copyright 2007 Amazon Technologies, Inc. Licensed under the Apache License, Version 2.0 (the "License"); * * You may not use this file except in compliance with the License. You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 This file is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. * ***************************************************************************** __ _ _ ___ ( )( \/\/ )/ __) /__\ \ / \__ \ (_)(_) \/\/ (___/ * * Amazon Simple DB Java Library API Version: 2007-11-07 Generated: Fri Jan 18 01:13:17 PST 2008 * */ import java.math.BigDecimal; public class Main { private static BigDecimal tryToStoreAsIntegerBigDecimal(Object ob) { BigDecimal bigDecimal = null; if (canBeStoredAsIntegerBigDecimal(ob)) { bigDecimal = new BigDecimal(ob.toString()); } return bigDecimal; } private static boolean canBeStoredAsIntegerBigDecimal(Object ob) { return ob instanceof Number && !(ob instanceof Float || ob instanceof Double); } }