contextprovider/annotationprocessor/src/main/java/io/tracee/contextlogger/contextprovider/api/TraceeContextLoggerAbstractTypeAnnotationProcessor.java
protected boolean checkIfClassHasNoargsConstructor(TypeElement typeElement) {

        // check if annotated class has noargs constructor
        boolean foundConstructor = false;
        boolean foundNoargsConstructor = false;

        for (Element child : typeElement.getEnclosedElements()) {
            if (ElementKind.CONSTRUCTOR.equals(child.getKind())) {
                foundConstructor = true;
                ExecutableElement constructor = (ExecutableElement) child;
                if (constructor.getParameters().size() == 0) {
                    foundNoargsConstructor = true;
                    break;
                }
            }
        }
        return !(foundConstructor && !foundNoargsConstructor);

    }
protected boolean checkIfClassHasNoargsConstructor(TypeElement typeElement) {

        // check if annotated class has noargs constructor
        boolean foundConstructor = false;
        boolean foundNoargsConstructor = false;

        for (Element child : typeElement.getEnclosedElements()) {
            if (ElementKind.CONSTRUCTOR.equals(child.getKind())) {
                foundConstructor = true;
                ExecutableElement constructor = (ExecutableElement) child;
                if (constructor.getParameters().size() == 0) {
                    foundNoargsConstructor = true;
                    break;
                }
            }
        }
        return !(foundConstructor && !foundNoargsConstructor);

    }
Checks if class has noargs constructor or default noargs constructor.

@param typeElement the type element to check.
@return true if element has noarg constructor or no constructor at all