Java Object Create as(Class t, Object o)

Here you can find the source of as(Class t, Object o)

Description

as

License

Open Source License

Declaration

public static <T> T as(Class<T> t, Object o) 

Method Source Code

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

public class Main {
    public static <T> T as(Class<T> t, Object o) {
        return t.isInstance(o) ? t.cast(o) : null;
    }//from  w  w  w .ja  v  a 2  s.c  o m
}

Related

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