@Test public void shouldGetFormatByItsName() { final ExportFormat csvFormat = service.getByName(CSVFormat.CSV); Assert.assertTrue(csvFormat instanceof CSVFormat); }
public ExportFormat getByName(String formatName) { return types .stream() .filter(f -> equalsIgnoreCase(formatName, f.getName())) .findFirst() .orElse(null); }
FormatRegistrationService { public ExportFormat getByName(String formatName) { return types .stream() .filter(f -> equalsIgnoreCase(formatName, f.getName())) .findFirst() .orElse(null); } }
FormatRegistrationService { public ExportFormat getByName(String formatName) { return types .stream() .filter(f -> equalsIgnoreCase(formatName, f.getName())) .findFirst() .orElse(null); } FormatRegistrationService(List<ExportFormat> types); }
FormatRegistrationService { public ExportFormat getByName(String formatName) { return types .stream() .filter(f -> equalsIgnoreCase(formatName, f.getName())) .findFirst() .orElse(null); } FormatRegistrationService(List<ExportFormat> types); Stream<ExportFormat> getExternalFormats(); ExportFormat getByName(String formatName); }
FormatRegistrationService { public ExportFormat getByName(String formatName) { return types .stream() .filter(f -> equalsIgnoreCase(formatName, f.getName())) .findFirst() .orElse(null); } FormatRegistrationService(List<ExportFormat> types); Stream<ExportFormat> getExternalFormats(); ExportFormat getByName(String formatName);  }