add convenience constructor to make a reference to an entityType from the entityType

This commit is contained in:
danikov 2012-02-29 11:31:53 +00:00
parent 633dd489b1
commit 6bed78b5a0
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,10 @@ public class Reference extends ReferenceType<Reference> {
public Builder fromReference(Reference in) { public Builder fromReference(Reference in) {
return fromReferenceType(in); return fromReferenceType(in);
} }
public Builder fromEntity(EntityType<?> in) {
return href(in.getHref()).id(in.getId()).name(in.getName()).type(in.getType());
}
} }
public Reference(URI href, String id, String name, String type) { public Reference(URI href, String id, String name, String type) {