Skip to content

Commit

Permalink
Log class name rather than requiring implementation from each class
Browse files Browse the repository at this point in the history
  • Loading branch information
avarsava committed Apr 22, 2024
1 parent e49c21d commit f0dc1c1
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ protected <F> F convert(
ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.added(start, end);
}

@Override
protected String getName() {
return "Last generated by olive";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ protected <F> F convert(
long offset, ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.addedAgo(offset);
}

@Override
protected String getOperation() {
return "Last generated by olive (ago)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ public <F> F convert(
long offset, ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.checkedAgo(offset);
}

@Override
protected String getOperation() {
return "Last run by scheduler (ago)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ public <F> F convert(
ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.checked(start, end);
}

@Override
protected String getName() {
return "created";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ public <F> F convert(
long offset, ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.createdAgo(offset);
}

@Override
protected String getOperation() {
return "created (ago)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ public <F> F convert(
ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.external(start, end);
}

@Override
protected String getName() {
return "External Modification";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@ public <F> F convert(
long offset, ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.externalAgo(offset);
}

@Override
protected String getOperation() {
return "External Modification (ago)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ public <F> F convert(
ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.statusChanged(start, end);
}

@Override
protected String getName() {
return "last state change";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ public <F> F convert(
long offset, ActionFilterBuilder<F, ActionState, String, Instant, Long> filterBuilder) {
return filterBuilder.statusChangedAgo(offset);
}

@Override
protected String getOperation() {
return "Last status change";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ public final void setOffset(long offset) {
@Override
public String toString() {
StringBuilder writeOut = new StringBuilder();
writeOut.append(getOperation()).append(" filter of offset: ").append(offset);
writeOut.append(this.getClass()).append(" type filter of offset: ").append(offset);
return writeOut.toString();
}

protected abstract String getOperation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ public final void setStart(Long start) {
this.start = start;
}

protected abstract String getName();

@Override
public String toString() {
StringBuilder writeOut = new StringBuilder();
writeOut
.append("Range filter of type: ")
.append(getName())
.append(this.getClass())
.append(" between ")
.append(start)
.append(" and ")
Expand Down

0 comments on commit f0dc1c1

Please sign in to comment.