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;
}

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 .
