Spring Framework应用
- org.springframework.core.env.JOptCommandLinePropertySource
@Override
public List<String> getOptionValues(String name) {
List<?> argValues = this.source.valuesOf(name);
List<String> stringArgValues = new ArrayList<String>();
for (Object argValue : argValues) {
stringArgValues.add(argValue.toString());
}
if (stringArgValues.isEmpty()) {
// 泛型应用
return (this.source.has(name) ? Collections.<String>emptyList() : null);
}
return Collections.unmodifiableList(stringArgValues);
}