Skip to content

Commit fca5874

Browse files
committed
edit
1 parent 10928ef commit fca5874

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

src/main/java/org/usf/jquery/core/TypedComparator.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static org.usf.jquery.core.ParameterSet.ofParameters;
55

66
import lombok.Getter;
7+
import lombok.experimental.Delegate;
78

89
/**
910
*
@@ -13,19 +14,15 @@
1314
@Getter
1415
public final class TypedComparator implements Comparator {
1516

16-
private final Comparator comparator; // do not delegate
17+
@Delegate
18+
private final Comparator comparator;
1719
private final ParameterSet parameterSet;
1820

1921
public TypedComparator(Comparator comparator, Parameter... parameters) {
2022
this.comparator = comparator;
2123
this.parameterSet = ofParameters(parameters);
2224
}
2325

24-
@Override
25-
public String id() {
26-
return comparator.id();
27-
}
28-
2926
@Override
3027
public String sql(QueryVariables builder, Object[] args) {
3128
try {
@@ -35,9 +32,9 @@ public String sql(QueryVariables builder, Object[] args) {
3532
}
3633
}
3734

38-
@Override
39-
public boolean is(Class<? extends Comparator> type) {
40-
return comparator.is(type);
35+
@Override // do not delegate this
36+
public ColumnSingleFilter filter(Object... args) {
37+
return Comparator.super.filter(args);
4138
}
4239

4340
@Override

src/main/java/org/usf/jquery/core/TypedOperator.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static org.usf.jquery.core.ParameterSet.ofParameters;
55

66
import lombok.Getter;
7+
import lombok.experimental.Delegate;
78

89
/**
910
*
@@ -13,7 +14,8 @@
1314
@Getter
1415
public class TypedOperator implements Operator {
1516

16-
private final Operator operator; // do not delegate
17+
@Delegate
18+
private final Operator operator;
1719
private final ArgTypeRef typeFn;
1820
private final ParameterSet parameterSet;
1921

@@ -27,11 +29,6 @@ public TypedOperator(ArgTypeRef typeFn, Operator function, Parameter... paramete
2729
this.parameterSet = ofParameters(parameter);
2830
}
2931

30-
@Override
31-
public String id() {
32-
return operator.id();
33-
}
34-
3532
@Override
3633
public String sql(QueryVariables builder, Object[] args) {
3734
try {
@@ -41,16 +38,16 @@ public String sql(QueryVariables builder, Object[] args) {
4138
throw badArgumentsException("operator", operator.id(), args, e);
4239
}
4340
}
44-
45-
@Override
46-
public boolean is(Class<? extends Operator> type) {
47-
return operator.is(type);
48-
}
4941

5042
public OperationColumn operation(Object... args) {
51-
return Operator.super.operation(typeFn.apply(args), args);
43+
return this.operation(typeFn.apply(args), args);
5244
}
5345

46+
@Override // do not delegate this
47+
public OperationColumn operation(JDBCType type, Object... args) {
48+
return Operator.super.operation(type, args);
49+
}
50+
5451
public boolean isWindowFunction() {
5552
return operator.is(WindowFunction.class);
5653
}

0 commit comments

Comments
 (0)