@ SuppressWarnings ( { "unchecked" , "unused" } ) public < T > T get ( String key , Class < T > type ) { try { return ( T ) state . get ( key ) ; } catch ( ClassCastException cce ) { return null ; } }
This get method will return the value if its type matches the type parameter