private void putResultType(final JsonRepresentation representation, final ResultType resultType) {
representation.mapPut("resulttype", resultType.getValue());
}
private JsonRepresentation representationWithSelfFor(final ObjectAction action, final JsonRepresentation bodyArgs) {
final JsonRepresentation links = JsonRepresentation.newArray();
representation.mapPut("links", links);
final LinkBuilder selfLinkBuilder = adapterLinkTo.memberBuilder(Rel.SELF, MemberType.ACTION, action, RepresentationType.ACTION_RESULT, "invoke");
// TODO: remove duplication with AbstractObjectMember#addLinkTo
final MemberType memberType = MemberType.of(action);
final Map<String, MutatorSpec> mutators = memberType.getMutators();
final ActionSemantics semantics = ActionSemantics.determine(getResourceContext(), action);
final String mutator = semantics.getInvokeKey();
final MutatorSpec mutatorSpec = mutators.get(mutator);
selfLinkBuilder.withHttpMethod(mutatorSpec.httpMethod);
final JsonRepresentation selfLink = selfLinkBuilder.build();
links.arrayAdd(selfLink);
selfLink.mapPut("args", bodyArgs);
return representation;
}