private Validation<List<SMFParseError>, Optional<SMFComponentType>> parseComponentType( final String text) { if (Objects.equals(text, "-")) { return valid(Optional.empty()); } try { return valid(Optional.of(SMFComponentType.of(text))); } catch (final IllegalArgumentException e) { return invalid(List.of(SMFParseError.of( this.reader.position(), "Could not parse component type: " + e.getMessage(), Optional.of(e)))); } }
type = Optional.empty(); } else { type = Optional.of(SMFComponentType.of(type_text));
SMFAttributeName.of(line.get(1)); final SMFComponentType type = SMFComponentType.of(line.get(2)); final int count = Integer.parseUnsignedInt(line.get(3));