use of org.opendaylight.mdsal.binding.model.api.ParameterizedType in project controller by opendaylight.
the class TemplateFactory method serializeType.
// FIXME: put into Type.toString
static String serializeType(final Type type, final boolean addWildcards) {
if (type instanceof ParameterizedType) {
final ParameterizedType parameterizedType = (ParameterizedType) type;
final StringBuilder sb = new StringBuilder();
sb.append(parameterizedType.getRawType().getFullyQualifiedName());
sb.append(addWildcards ? "<? extends " : "<");
boolean first = true;
for (final Type parameter : parameterizedType.getActualTypeArguments()) {
if (first) {
first = false;
} else {
sb.append(",");
}
sb.append(serializeType(parameter));
}
sb.append(">");
return sb.toString();
} else {
return type.getFullyQualifiedName();
}
}
Aggregations