this.objectAdapter = objectAdapter;
}
public Representation build() {
RepContext repContext = this.repContext.underAttribute("_self");
Representation selfLink = LinkRepBuilder.newBuilder(repContext, "link", url()).build();
Representation selfType = LinkRepBuilder.newTypeBuilder(repContext, "type", objectAdapter.getSpecification()).build();
String title = objectAdapter.titleString();
Representation iconLink = LinkRepBuilder.newBuilder(repContext, "icon", icon()).build();
Representation self = new Representation();
self.put("link", selfLink);
self.put("type", selfType);
self.put("title", title);
self.put("icon", iconLink);
representation.put("_self", self);
withAllMembers(objectAdapter);
if(!members.isEmpty()) {
for(Map.Entry<String, Representation> entry: members.entrySet()) {
String memberId = entry.getKey();
Representation memberRep = entry.getValue();
representation.put(memberId, memberRep);
}
}
return representation;
}