code: 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;
      }
docs: Converts a TSDB entity to a DTO.
  
  @param   <D>         The TSDB DTO type.
  @param   <E>         The TSDB entity type.
  @param   clazz       The runtime type of the DTO object.
  @param   tsdbEntity  The TSDB entity to convert.
  
  @return  The TSDB DTO.
  
  @throws  WebApplicationException  If an error occurs.