Class ClassPatternRule

java.lang.Object
de.thetaphi.forbiddenapis.ClassPatternRule

public final class ClassPatternRule extends Object
  • Field Details

    • pattern

      private final Pattern pattern
    • glob

      private final String glob
    • message

      private final String message
  • Constructor Details

    • ClassPatternRule

      public ClassPatternRule(String glob, String message)
      Create new rule for class glob and given printout
  • Method Details

    • matches

      public boolean matches(String className)
      returns true, if the given class (binary name, dotted) matches this rule.
    • getPrintout

      public String getPrintout(String className)
      returns the printout using the message and the given class name
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object