File tree Expand file tree Collapse file tree
src/main/java/org/scijava/ops/types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,18 @@ public Nil(final Object callbacks) {
9595 this .callbacks = callbacks (callbacks );
9696 }
9797
98+ /**
99+ * Creates a {@code Nil} wrapping the given raw {@link Class}.
100+ * <p>
101+ * This method is intentionally private; use {@link Nil#of(Class)} to create
102+ * such a {@code Nil} from calling code.
103+ * </p>
104+ */
105+ private Nil (final Class <T > rawType ) {
106+ typeToken = TypeToken .of (rawType );
107+ callbacks = this ;
108+ }
109+
98110 /**
99111 * Creates a {@code Nil} wrapping the given generic {@link Type}.
100112 * <p>
@@ -122,6 +134,10 @@ private Nil(final Type type, final Object callbacks) {
122134
123135 // -- Static utility methods --
124136
137+ public static <T > Nil <T > of (final Class <T > rawType ) {
138+ return new Nil <T >(rawType ) {};
139+ }
140+
125141 /**
126142 * Creates a {@code Nil} of the given generic {@link Type}, with no extra
127143 * method callbacks.
You can’t perform that action at this time.
0 commit comments