private final ConsoleIO console;
- public UnionTypeReader(final ConsoleIO console) {
+ UnionTypeReader(final ConsoleIO console) {
this.console = console;
}
}
final TypeDefinition<?> value = mapping.get(rawValue);
if (value != null) {
- return Optional.<TypeDefinition<?>> of(value);
+ return Optional.of(value);
} else {
- final String message = String.format("Incorrect type (%s) was specified for union type definition", rawValue);
+ final String message = String.format(
+ "Incorrect type (%s) was specified for union type definition", rawValue);
LOG.error(message);
throw new ReadingException(message);
}
private final TypeDefinition<?> typeDef;
private final Map<String, TypeDefinition<?>> menuItemsToTypeDefinitions = new HashMap<>();
- public UnionConsoleContext(final TypeDefinition<?> typeDef) {
+ UnionConsoleContext(final TypeDefinition<?> typeDef) {
this.typeDef = typeDef;
}
public Completer getCompleter() {
List<TypeDefinition<?>> subtypesForMenu = resolveSubtypesFrom(typeDef);
if (subtypesForMenu.isEmpty()) {
- subtypesForMenu = Collections.<TypeDefinition<?>> singletonList(typeDef);
+ subtypesForMenu = Collections.singletonList(typeDef);
}
final Collection<String> menuItems = toMenuItem(subtypesForMenu);
return new AggregateCompleter(new StringsCompleter(menuItems), new StringsCompleter(IOUtil.SKIP));
}
/**
- *
* If union type is found in potentialEndTypeCandidate as subtype then
* it these subtypes become candidates.
*