Java Object Create as(Class type, Object value)

Here you can find the source of as(Class type, Object value)

Description

as

License

Apache License

Declaration

public static <T> T as(Class<T> type, Object value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static <T> T as(Class<T> type, Object value) {
        if (type.isInstance(value)) {
            return type.cast(value);
        }/*from   ww w .j av  a 2  s  .  com*/
        return null;
    }
}

Related

  1. as(Class clazz, I instance)
  2. as(Class cls, Object o)
  3. as(Class t, Object o)
  4. as(Class targetClass, Object entity)
  5. as(Class type, U o)
  6. as(Object cst)
  7. as(Object instance, Class clazz)
  8. as(Object o)