@Test public void shouldReturnNullIfDateColumnNotIncluded() throws Exception { EDIConfiguration configuration = new EDIConfiguration(); List<EDIFileColumn> columns = new ArrayList<>(); EDIFileColumn column = new EDIFileColumn("periodStartDate", "Period Start Date", false, true, 1, "dd/MM/yy"); columns.add(column); EDIFileTemplate fileTemplate = new EDIFileTemplate(configuration, columns); assertNull(fileTemplate.getDateFormatForColumn("periodStartDate")); }
@JsonIgnore public String getDateFormatForColumn(final String columnName) { EDIFileColumn column = (EDIFileColumn) CollectionUtils.find(this.columns, new Predicate() { @Override public boolean evaluate(Object o) { EDIFileColumn fileColumn = (EDIFileColumn) o; return fileColumn.getName().equals(columnName) && fileColumn.getInclude(); } }); return column == null ? null : column.getDatePattern(); }
EDIFileTemplate { @JsonIgnore public String getDateFormatForColumn(final String columnName) { EDIFileColumn column = (EDIFileColumn) CollectionUtils.find(this.columns, new Predicate() { @Override public boolean evaluate(Object o) { EDIFileColumn fileColumn = (EDIFileColumn) o; return fileColumn.getName().equals(columnName) && fileColumn.getInclude(); } }); return column == null ? null : column.getDatePattern(); } }
EDIFileTemplate { @JsonIgnore public String getDateFormatForColumn(final String columnName) { EDIFileColumn column = (EDIFileColumn) CollectionUtils.find(this.columns, new Predicate() { @Override public boolean evaluate(Object o) { EDIFileColumn fileColumn = (EDIFileColumn) o; return fileColumn.getName().equals(columnName) && fileColumn.getInclude(); } }); return column == null ? null : column.getDatePattern(); }  }
EDIFileTemplate { @JsonIgnore public String getDateFormatForColumn(final String columnName) { EDIFileColumn column = (EDIFileColumn) CollectionUtils.find(this.columns, new Predicate() { @Override public boolean evaluate(Object o) { EDIFileColumn fileColumn = (EDIFileColumn) o; return fileColumn.getName().equals(columnName) && fileColumn.getInclude(); } }); return column == null ? null : column.getDatePattern(); }  Collection<EDIFileColumn> filterIncludedColumns(); void validateAndSetModifiedBy(Long userId, List<String> mandatoryColumnNames); @JsonIgnore Integer getRowOffset(); @JsonIgnore String getDateFormatForColumn(final String columnName); }
EDIFileTemplate { @JsonIgnore public String getDateFormatForColumn(final String columnName) { EDIFileColumn column = (EDIFileColumn) CollectionUtils.find(this.columns, new Predicate() { @Override public boolean evaluate(Object o) { EDIFileColumn fileColumn = (EDIFileColumn) o; return fileColumn.getName().equals(columnName) && fileColumn.getInclude(); } }); return column == null ? null : column.getDatePattern(); }  Collection<EDIFileColumn> filterIncludedColumns(); void validateAndSetModifiedBy(Long userId, List<String> mandatoryColumnNames); @JsonIgnore Integer getRowOffset(); @JsonIgnore String getDateFormatForColumn(final String columnName);  }