code: public T toDomain(RiakObject obj, Location location)
      {
          T domainObject;
          if (obj.isDeleted())
          {
              domainObject = newDomainInstance();
          }
          else
          {
              domainObject = toDomain(obj.getValue(), obj.getContentType());
  
              AnnotationUtil.populateIndexes(obj.getIndexes(), domainObject);
              AnnotationUtil.populateLinks(obj.getLinks(), domainObject);
              AnnotationUtil.populateUsermeta(obj.getUserMeta(), domainObject);
              AnnotationUtil.setContentType(domainObject, obj.getContentType());
              AnnotationUtil.setVTag(domainObject, obj.getVTag());
          }
  
          AnnotationUtil.setKey(domainObject, location.getKey());
          AnnotationUtil.setBucketName(domainObject, location.getNamespace().getBucketName());
          AnnotationUtil.setBucketType(domainObject, location.getNamespace().getBucketType());
  
          AnnotationUtil.setVClock(domainObject, obj.getVClock());
          AnnotationUtil.setTombstone(domainObject, obj.isDeleted());
          AnnotationUtil.setLastModified(domainObject, obj.getLastModified());
  
          return domainObject;
      }
docs: Converts from a RiakObject to a domain object.
  
  @param obj the RiakObject to be converted
  @param location The location of this RiakObject in Riak
  @return an instance of the domain type T