public static < T > T validate ( InputStream input , final Class < T > clazz ) throws IOException { return JSON . parseObject ( input , clazz ) ; }
Validates an input and returns an instance of a given class constructed from the input .