/** * Copyright (C) 2010-2017 Gordon Fraser, Andrea Arcuri and EvoSuite * contributors * * This file is part of EvoSuite. * * EvoSuite is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3.0 of the License, or * (at your option) any later version. * * EvoSuite is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with EvoSuite. If not, see <http://www.gnu.org/licenses/>. */ package com.examples.with.different.packagename.testcarver; /** * {@link NumberConverter} implementation that handles conversion to * and from <b>java.lang.Integer</b> objects. * <p> * This implementation can be configured to handle conversion either * by using Integer's default String conversion, or by using a Locale's pattern * or by specifying a format pattern. See the {@link NumberConverter} * documentation for further details. * <p> * Can be configured to either return a <i>default value</i> or throw a * <code>ConversionException</code> if a conversion error occurs. * * @author Craig R. McClanahan * @version $Revision: 690380 $ $Date: 2008-08-29 21:04:38 +0100 (Fri, 29 Aug 2008) $ * @since 1.3 */ public final class IntegerConverter extends NumberConverter { /** * Construct a <b>java.lang.Integer</b> <i>Converter</i> that throws * a <code>ConversionException</code> if an error occurs. */ public IntegerConverter() { super(false); } /** * Construct a <b>java.lang.Integer</b> <i>Converter</i> that returns * a default value if an error occurs. * * @param defaultValue The default value to be returned * if the value to be converted is missing or an error * occurs converting the value. */ public IntegerConverter(Object defaultValue) { super(false, defaultValue); } /** * Return the default type this <code>Converter</code> handles. * * @return The default type this <code>Converter</code> handles. * @since 1.8.0 */ protected Class getDefaultType() { return Integer.class; } }