Skip to content

Commit

Permalink
Remove logging statements from ValidationMethods of ValidityDate
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsrnhld committed Jul 25, 2023
1 parent 5c82809 commit 0e8c32b
Showing 1 changed file with 5 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,55 +48,32 @@ public boolean isForConnectorsTable() {

boolean columnNotForConnector = column != null && !column.getTable().equals(connector.getTable());

if (anyColumnNotForConnector || columnNotForConnector) {
log.error("{} does not belong to Connector[{}]#Table[{}]", this, connector.getId(), connector.getTable().getId());
}

return true;
return !anyColumnNotForConnector && !columnNotForConnector;
}

@JsonIgnore
@ValidationMethod(message = "Single column date range (set via column) and two column date range (set via startColumn and endColumn) are exclusive.")
public boolean isExclusiveValidityDates() {

if ((column == null && startColumn != null && endColumn != null)
|| (column != null && startColumn == null && endColumn == null)) {
return true;
}
log.error("Single column date range (set via column) and two column date range (set via startColumn and endColumn) are exclusive.");
return false;
return (column == null && startColumn != null && endColumn != null)
|| (column != null && startColumn == null && endColumn == null);
}

@JsonIgnore
@ValidationMethod(message = "Both columns of a two-column validity date have to be of type DATE.")
public boolean isValidTwoColumnValidityDates() {

if (startColumn == null || endColumn == null) {
return true;
}

if (startColumn.getType() == MajorTypeId.DATE && endColumn.getType() == MajorTypeId.DATE) {
return true;
}

log.error("Start column [{}] and end column [{}] have to be of type DATE.", startColumn.getId(), endColumn.getId());
return false;
return startColumn.getType() == MajorTypeId.DATE && endColumn.getType() == MajorTypeId.DATE;
}

@JsonIgnore
@ValidationMethod(message = "Column is not of type DATE or DATE_RANGE.")
public boolean isValidValidityDatesSingleColumn() {

if (column == null) {
return true;
}

if (column.getType().isDateCompatible()) {
return true;
}

log.error("ValidityDate-Column[{}] is not of type DATE or DATERANGE", column.getId());
return false;
return column.getType().isDateCompatible();
}

@JsonIgnore
Expand Down

0 comments on commit 0e8c32b

Please sign in to comment.