public ClassModifierMask(int mask) {
        super(mask);

        final int enabledFlags =
            ((isInterface())? 1 : 0) +
            ((isAnnotation())? 1 : 0) +
            ((isEnum())? 1 : 0);

        if (enabledFlags == 0) {
            classType = ClassTypeModifier.CLASS;
        }
        else if (enabledFlags == 1) {
            if (isInterface()) {
                classType = ClassTypeModifier.INTERFACE;
            }
            else if (isAnnotation()) {
                classType = ClassTypeModifier.ANNOTATION;
            }
            else { //enum
                classType = ClassTypeModifier.ENUM;
            }
        }
        else {
            throw new IllegalArgumentException("Wrong class type provided in the mask");
        }
    }