Java Object Create toObject(final int i)

Here you can find the source of toObject(final int i)

Description

to Object

License

Open Source License

Declaration

public static Integer toObject(final int i) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015, 2017 Lablicate GmbH.
 *
 * 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:// ww  w.  j ava 2s. c  o m
 * Dr. Alexander Kerner - initial API and implementation
 *******************************************************************************/

public class Main {
    public static Byte toObject(final byte i) {

        return Byte.valueOf(i);
    }

    public static Byte[] toObject(final byte[] arr) {

        final Byte[] result = new Byte[arr.length];
        for (int i = 0; i < arr.length; i++)
            result[i] = arr[i];
        return result;
    }

    public static Double toObject(final double d) {

        return Double.valueOf(d);
    }

    public static Double[] toObject(final double[] arr) {

        final Double[] result = new Double[arr.length];
        for (int i = 0; i < arr.length; i++)
            result[i] = arr[i];
        return result;
    }

    public static Integer toObject(final int i) {

        return Integer.valueOf(i);
    }

    public static Integer[] toObject(final int[] arr) {

        final Integer[] result = new Integer[arr.length];
        for (int i = 0; i < arr.length; i++)
            result[i] = arr[i];
        return result;
    }
}

Related

  1. toObject(byte[] array)
  2. toObject(byte[] byteArray)
  3. toObject(byte[] primitiveArray)
  4. toObject(Class clazz, String value)
  5. toObject(double[] a)
  6. toObject(int[] array)
  7. toObject(int[] values)
  8. toObject(long[] array)
  9. toObject(Object value)