Java Object Create toObject(short s)

Here you can find the source of toObject(short s)

Description

to Object

License

Apache License

Declaration

static Object toObject(short s) 

Method Source Code

//package com.java2s;
/**// w ww  . j a  v a  2 s  .com
 * Copyright 2011 Sean J. Barbeau
 * 
 * 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://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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. 
 * 
 **/

public class Main {
    static Object toObject(byte b) {
        return new Byte(b);
    }

    static Object toObject(short s) {
        return new Short(s);
    }

    static Object toObject(char c) {
        return new Character(c);
    }

    static Object toObject(int i) {
        return new Integer(i);
    }

    static Object toObject(long l) {
        return new Long(l);
    }

    static Object toObject(float f) {
        return new Float(f);
    }

    static Object toObject(double d) {
        return new Double(d);
    }

    static Object toObject(boolean b) {
        return new Boolean(b);
    }

    static Object toObject(Object o) {
        return o;
    }
}

Related

  1. toObject(final int i)
  2. toObject(int[] array)
  3. toObject(int[] values)
  4. toObject(long[] array)
  5. toObject(Object value)
  6. toObject(short value)