Class OuterTypeFilenameCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class OuterTypeFilenameCheck
    extends AbstractCheck

    Checks that the outer type name and the file name match. For example, the class Foo must be in a file named

    To configure the check:

     <module name="OuterTypeFilename"/>

    Example of class Test in a file named

     public class Test { // OK

    Example of class Foo in a file named

     class Foo { // violation

    Example of interface Foo in a file named

     interface Foo { // violation

    Example of enum Foo in a file named

     enum Foo { // violation

    Example of record Foo in a file named

     record Foo { // violation

    Parent is

    Violation Message Keys:

    • type.file.mismatch