void generateNonIgnorableFieldCheck(HeaderGenerator headerGenerator,
                                        StructRegistry structRegistry,
                                        String fieldPrefix,
                                        CodeBuffer buffer) {
        generateNonDefaultValueCheck(headerGenerator, structRegistry,
            buffer, fieldPrefix, nullableVersions());
        buffer.incrementIndent();
        headerGenerator.addImport(MessageGenerator.UNSUPPORTED_VERSION_EXCEPTION_CLASS);
        buffer.printf("throw new UnsupportedVersionException(" +
                "\"Attempted to write a non-default %s at version \" + _version);%n",
            camelCaseName());
        buffer.decrementIndent();
        buffer.printf("}%n");
    }
Generate an if statement that checks if this field is non-default and also
non-ignorable.

@param headerGenerator   The header generator in case we need to add imports.
@param structRegistry    The struct registry in case we need to look up structs.
@param fieldPrefix       The prefix to prepend before references to this field.
@param buffer            The code buffer to write to.
generator/src/main/java/org/apache/kafka/message/FieldSpec.java