Java Object Type Case cast(Object inValue)

Here you can find the source of cast(Object inValue)

Description

cast

License

Open Source License

Declaration

public static <T> T cast(Object inValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static <T> T cast(Object inValue) {
        return cast(inValue, null);
    }//from w w w.j  a  va  2s.c o m

    @SuppressWarnings("unchecked")
    public static <T> T cast(Object inValue, T inDefault) {
        try {
            return (T) inValue;
        } catch (Exception e) {
            return inDefault;
        }
    }
}

Related

  1. cast(final Object object)
  2. cast(final Object original)
  3. cast(int value)
  4. cast(int value)
  5. cast(long value)
  6. cast(Object o)
  7. cast(Object o, Class clazz)
  8. cast(Object o, Class klass)
  9. cast(Object o, String clazz)