Skip to content

Commit a914936

Browse files
committed
Refactor function list initialization in CtTypes
1 parent b0e9ea9 commit a914936

File tree

1 file changed

+27
-27
lines changed
  • doma-processor/src/main/java/org/seasar/doma/internal/apt/cttype

1 file changed

+27
-27
lines changed

doma-processor/src/main/java/org/seasar/doma/internal/apt/cttype/CtTypes.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import java.time.LocalDate;
3434
import java.time.LocalDateTime;
3535
import java.time.LocalTime;
36-
import java.util.Arrays;
3736
import java.util.Collections;
3837
import java.util.Iterator;
3938
import java.util.List;
@@ -120,6 +119,33 @@
120119

121120
public class CtTypes {
122121

122+
// Apply newDomainCtType, newEmbeddableCtType and newEntityCtType functions first.
123+
private final List<Function<TypeMirror, CtType>> functions =
124+
List.of(
125+
this::newDomainCtType,
126+
this::newEmbeddableCtType,
127+
this::newEntityCtType,
128+
this::newIterableCtType,
129+
this::newStreamCtType,
130+
this::newOptionalCtType,
131+
this::newOptionalIntCtType,
132+
this::newOptionalLongCtType,
133+
this::newOptionalDoubleCtType,
134+
this::newBasicCtType,
135+
this::newMapCtType,
136+
this::newSelectOptionsCtType,
137+
this::newFunctionCtType,
138+
this::newCollectorCtType,
139+
this::newReferenceCtType,
140+
this::newBiFunctionCtType,
141+
this::newBiConsumerCtType,
142+
this::newPreparedSqlCtType,
143+
this::newConfigCtType,
144+
this::newResultCtType,
145+
this::newBatchResultCtType,
146+
this::newMultiResultCtType,
147+
this::newArrayCtType);
148+
123149
private final RoundContext ctx;
124150

125151
public CtTypes(RoundContext ctx) {
@@ -663,32 +689,6 @@ public CtType newCtType(TypeMirror type) {
663689

664690
private CtType newCtTypeInternal(
665691
TypeMirror type, CtTypeVisitor<Void, Void, AptException> validator) {
666-
// Apply newDomainCtType, newEmbeddableCtType and newEntityCtType functions first.
667-
List<Function<TypeMirror, CtType>> functions =
668-
Arrays.asList(
669-
this::newDomainCtType,
670-
this::newEmbeddableCtType,
671-
this::newEntityCtType,
672-
this::newIterableCtType,
673-
this::newStreamCtType,
674-
this::newOptionalCtType,
675-
this::newOptionalIntCtType,
676-
this::newOptionalLongCtType,
677-
this::newOptionalDoubleCtType,
678-
this::newBasicCtType,
679-
this::newMapCtType,
680-
this::newSelectOptionsCtType,
681-
this::newFunctionCtType,
682-
this::newCollectorCtType,
683-
this::newReferenceCtType,
684-
this::newBiFunctionCtType,
685-
this::newBiConsumerCtType,
686-
this::newPreparedSqlCtType,
687-
this::newConfigCtType,
688-
this::newResultCtType,
689-
this::newBatchResultCtType,
690-
this::newMultiResultCtType,
691-
this::newArrayCtType);
692692
CtType ctType =
693693
functions.stream()
694694
.map(f -> f.apply(type))

0 commit comments

Comments
 (0)