Here you can find the source of fromIntegerString(String integerString)
Parameter | Description |
---|---|
integerString | The Integer as string. |
public static Integer fromIntegerString(String integerString)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Peter Lachenmaier - Cooperation Systems Center Munich (CSCM). * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * //from w w w . java 2s . co m * Contributors: * Peter Lachenmaier - Design and initial implementation ******************************************************************************/ public class Main { /** * Deserializes an Integer from a given string. * * @param integerString The Integer as string. * @return The Integer object or null if the parsing failed. */ public static Integer fromIntegerString(String integerString) { if (integerString == null) { return null; } try { Integer i = new Integer(integerString); return i; } catch (Exception e) { // no output } // error case return null; } }