File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/main/java/org/hibernate/models/spi Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,31 @@ default Kind getKind() {
97
97
*/
98
98
List <TypeVariableDetails > getTypeParameters ();
99
99
100
+ @ FunctionalInterface
101
+ interface ClassDetailsConsumer extends java .util .function .Consumer <ClassDetails > {
102
+ @ Override
103
+ void accept (ClassDetails classDetails );
104
+ }
105
+
106
+ /**
107
+ * Walk our super-classes passing each to the {@code consumer}
108
+ */
109
+ default void forEachSuper (ClassDetailsConsumer consumer ) {
110
+ ClassDetails check = getSuperClass ();
111
+ while ( check != null && check != OBJECT_CLASS_DETAILS ) {
112
+ consumer .accept ( check );
113
+ check = check .getSuperClass ();
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Pass ourselves into the {@code consumer} and then the same {@linkplain #forEachSuper for each super class}
119
+ */
120
+ default void forSelfAndEachSuper (ClassDetailsConsumer consumer ) {
121
+ consumer .accept ( this );
122
+ forEachSuper ( consumer );
123
+ }
124
+
100
125
@ Override
101
126
default TypeDetails resolveTypeVariable (String identifier ) {
102
127
final TypeVariableDetails local = TypeDetailsHelper .findTypeVariableDetails (
You can’t perform that action at this time.
0 commit comments