Java Object Type Case cast(String type)

Here you can find the source of cast(String type)

Description

cast

License

Open Source License

Declaration

public static String cast(String type) 

Method Source Code

//package com.java2s;
/**//from www .  j av a2s . c om
 * <copyright>
 *
 * Copyright (c) 2009, 2010 Springsite BV (The Netherlands) and others
 * 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
 *
 * Contributors:
 *   Martin Taal - Initial API and implementation
 *   IBM - getInstanceClass method
 *
 * </copyright>
 *
 * $Id: GenUtils.java,v 1.16 2011/08/25 12:35:07 mtaal Exp $
 */

public class Main {
    public static String cast(String type) {
        if (type == null) {
            return type;
        }
        if (type.equals(Object.class.getName())) {
            return ""; //$NON-NLS-1$
        }
        return "(" + type + ")"; //$NON-NLS-1$ //$NON-NLS-2$
    }
}

Related

  1. cast(Object val, Class type)
  2. cast(Object value, String sqlType)
  3. cast(Object x)
  4. cast(Object x)
  5. cast(Object[] parameters, Class[] types)
  6. castAndThrow(Throwable e)
  7. castArray(Object[] array, T[] targetArray)
  8. castAs(Class clazz, Object obj)
  9. castAsDoubleArray(int[] input)