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 ; }
Converts from a RiakObject to a domain object .