// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/AnnotationUtils.java
// public static DetailAST getAnnotation(DetailAST ast, String fullAnnotation) {
//   DetailAST simpleAnnotationAst =
//       AnnotationUtil.getAnnotation(ast, CommonUtils.getSimpleName(fullAnnotation));
//   return nonNull(simpleAnnotationAst) ? simpleAnnotationAst
//       : AnnotationUtil.getAnnotation(ast, fullAnnotation);
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/AnnotationUtils.java
// public static Boolean hasAnnotation(DetailAST ast, String fullAnnotation) {
//   return CommonUtils.getSimpleAndFullNames(fullAnnotation).stream()
//                     .anyMatch(annotation -> AnnotationUtil.containsAnnotation(ast, annotation));
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/ClassUtils.java
// public static Boolean isEntity(DetailAST classAst, String fullEntityAnnotation) {
//   return AnnotationUtils.hasAnnotation(classAst, fullEntityAnnotation);
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static String getSimpleName(String fullName) {
//   String[] packageNames = fullName.split("\\.");
//   return packageNames[packageNames.length - 1];
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/VariableUtils.java
// public static Map<String, DetailAST> getVariableNameAstMap(DetailAST classAst) {
//   List<DetailAST> variables = getVariables(classAst);
//   return variables.stream().collect(toMap(VariableUtils::getVariableName,
//                                           Function.identity(), (v1, v2) -> null,
//                                           LinkedHashMap::new));
// }


import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static es.startuphero.checkstyle.util.AnnotationUtils.getAnnotation;
import static es.startuphero.checkstyle.util.AnnotationUtils.hasAnnotation;
import static es.startuphero.checkstyle.util.ClassUtils.isEntity;
import static es.startuphero.checkstyle.util.CommonUtils.getSimpleName;
import static es.startuphero.checkstyle.util.VariableUtils.getVariableNameAstMap;

  /**
   * set abstract type annotation to understand that a class is abstract.
   */
  private String abstractTypeAnnotation;

  private String columnAnnotation;

  private String columnDefaultAnnotation;

  private String excludedColumnDefaultAnnotationValueRegex;

  @Override
  public int[] getDefaultTokens() {
    return getAcceptableTokens();
  }

  @Override
  public int[] getAcceptableTokens() {
    return new int[] {TokenTypes.CLASS_DEF};
  }

  @Override
  public int[] getRequiredTokens() {
    return getAcceptableTokens();
  }

  @Override
  public void visitToken(DetailAST ast) {
    if (isEntity(ast, typeAnnotation) || isEntity(ast, abstractTypeAnnotation)) {
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/AnnotationUtils.java
// public static DetailAST getAnnotation(DetailAST ast, String fullAnnotation) {
//   DetailAST simpleAnnotationAst =
//       AnnotationUtil.getAnnotation(ast, CommonUtils.getSimpleName(fullAnnotation));
//   return nonNull(simpleAnnotationAst) ? simpleAnnotationAst
//       : AnnotationUtil.getAnnotation(ast, fullAnnotation);
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/AnnotationUtils.java
// public static Boolean hasAnnotation(DetailAST ast, String fullAnnotation) {
//   return CommonUtils.getSimpleAndFullNames(fullAnnotation).stream()
//                     .anyMatch(annotation -> AnnotationUtil.containsAnnotation(ast, annotation));
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/ClassUtils.java
// public static Boolean isEntity(DetailAST classAst, String fullEntityAnnotation) {
//   return AnnotationUtils.hasAnnotation(classAst, fullEntityAnnotation);
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static String getSimpleName(String fullName) {
//   String[] packageNames = fullName.split("\\.");
//   return packageNames[packageNames.length - 1];
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/VariableUtils.java
// public static Map<String, DetailAST> getVariableNameAstMap(DetailAST classAst) {
//   List<DetailAST> variables = getVariables(classAst);
//   return variables.stream().collect(toMap(VariableUtils::getVariableName,
//                                           Function.identity(), (v1, v2) -> null,
//                                           LinkedHashMap::new));
// }


// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/checks/annotation/ColumnDefaultCheck.java
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static es.startuphero.checkstyle.util.AnnotationUtils.getAnnotation;
import static es.startuphero.checkstyle.util.AnnotationUtils.hasAnnotation;
import static es.startuphero.checkstyle.util.ClassUtils.isEntity;
import static es.startuphero.checkstyle.util.CommonUtils.getSimpleName;
import static es.startuphero.checkstyle.util.VariableUtils.getVariableNameAstMap;


  /**
   * set abstract type annotation to understand that a class is abstract.
   */
  private String abstractTypeAnnotation;

  private String columnAnnotation;

  private String columnDefaultAnnotation;

  private String excludedColumnDefaultAnnotationValueRegex;

  @Override
  public int[] getDefaultTokens() {
    return getAcceptableTokens();
  }

  @Override
  public int[] getAcceptableTokens() {
    return new int[] {TokenTypes.CLASS_DEF};
  }

  @Override
  public int[] getRequiredTokens() {
    return getAcceptableTokens();
  }

  @Override
  public void visitToken(DetailAST ast) {
    if (isEntity(ast, typeAnnotation) || isEntity(ast, abstractTypeAnnotation)) {
      Map<String, DetailAST> variableNameAstMap = getVariableNameAstMap(ast, false);