All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.core.NameChecker Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package org.snapscript.core;

public class NameChecker {
   
   private final boolean strict;
   
   public NameChecker(boolean strict) {
      this.strict = strict;
   }

   public boolean isEntity(String name) {
      int index = name.lastIndexOf(".");
      char first = name.charAt(index == -1 ? 0 : index + 1);
      
      if(strict) {
         return Character.isUpperCase(first) && Character.isAlphabetic(first);
      }
      return Character.isUpperCase(first);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy