+ void appendMaxCheck(final StringBuilder sb, final T max, final Function<Class<?>, String> classImporter) {
+ sb.append("value <= ").append(format(max));
+ }
+
+ void appendMinCheck(final StringBuilder sb, final T min, final Function<Class<?>, String> classImporter) {
+ sb.append("value >= ").append(format(min));
+ }
+
+ /**
+ * Format a value into a Java-compilable expression which results in the appropriate
+ * type.
+ *
+ * @param value Number value
+ * @return Java language string representation
+ */
+ protected abstract @NonNull String format(T value);
+
+ String codeHelpersThrow() {
+ return "throwInvalidRange";
+ }
+