public static < D extends TSDBEntityDto , E extends TSDBEntity > D createDtoObject ( Class < D > clazz , E tsdbEntity ) { D result = null ; try { result = clazz . newInstance ( ) ; BeanUtils . copyProperties ( result , tsdbEntity ) ; } catch ( Exception ex ) { throw new WebApplicationException ( "DTO transformation failed." , Status . INTERNAL_SERVER_ERROR ) ; } return result ; }
Converts a TSDB entity to a DTO .