use of org.jenkinsci.plugins.structs.describable.ParameterType in project blueocean-plugin by jenkinsci.
the class ExportedDescribableParameter method getCollectionTypes.
/**
* Java types allowed if this is a collection
* See {@link DescribableParameter#getType()} and {@link ParameterType#getActualType()}
*/
@Exported
public List<String> getCollectionTypes() {
List<String> collectionTypes = new ArrayList<>();
Type typ = param.getType().getActualType();
if (typ instanceof ParameterizedType) {
Type[] typeArgs = ((ParameterizedType) typ).getActualTypeArguments();
for (Type ptyp : typeArgs) {
if (ptyp instanceof Class<?>) {
collectionTypes.add(((Class<?>) ptyp).getName());
}
}
}
return collectionTypes;
}
Aggregations