use of org.nextprot.api.commons.utils.KeyValueRepresentation in project nextprot-api by calipho-sib.
the class InstrumentationAspect method addArgumentsParameters.
private static StringBuilder addArgumentsParameters(StringBuilder sb, Object[] arguments, Annotation[][] annotations) {
for (int i = 0; i < arguments.length; i++) {
Annotation[] annots = annotations[i];
Value v = null;
for (Annotation a : annots) {
if (a.annotationType().equals(Value.class)) {
v = (Value) a;
break;
}
}
if (v == null) {
sb.append("arg" + (i + 1));
} else {
sb.append(v.value());
}
sb.append("=");
Object argument = arguments[i];
if (argument == null) {
sb.append("null");
} else if (argument instanceof KeyValueRepresentation) {
sb.append(((KeyValueRepresentation) argument).toKeyValueString());
} else if (argument instanceof Collection) {
sb.append(((Collection<?>) argument).size());
} else if (argument instanceof String || argument instanceof Long || argument instanceof Short || argument instanceof Integer) {
sb.append(argument);
} else {
sb.append("representation-unknown");
}
sb.append(";");
}
return sb;
}
Aggregations