Record Class ThreadModeSettings

java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.ThreadModeSettings
Record Components:
checkerThreadsNumber - the Checker threads number
treeWalkerThreadsNumber - the TreeWalker threads number
All Implemented Interfaces:
Serializable

public record ThreadModeSettings(int checkerThreadsNumber, int treeWalkerThreadsNumber) extends Record implements Serializable
Thread mode settings for the checkstyle modules.
See Also:
  • Field Details

    • checkerThreadsNumber

      private final int checkerThreadsNumber
      The field for the checkerThreadsNumber record component.
    • treeWalkerThreadsNumber

      private final int treeWalkerThreadsNumber
      The field for the treeWalkerThreadsNumber record component.
    • CHECKER_MODULE_NAME

      public static final String CHECKER_MODULE_NAME
      A checker module name.
    • MULTI_THREAD_CHECKER_MODULE_NAME

      public static final String MULTI_THREAD_CHECKER_MODULE_NAME
      A multi thread checker module name.
    • TREE_WALKER_MODULE_NAME

      public static final String TREE_WALKER_MODULE_NAME
      A three walker module name.
    • MULTI_THREAD_TREE_WALKER_MODULE_NAME

      public static final String MULTI_THREAD_TREE_WALKER_MODULE_NAME
      A multi thread three walker module name.
    • SINGLE_THREAD_MODE_INSTANCE

      public static final ThreadModeSettings SINGLE_THREAD_MODE_INSTANCE
      A single thread mode settings instance.
    • serialVersionUID

      private static final long serialVersionUID
      A unique serial version identifier.
      See Also:
  • Constructor Details

    • ThreadModeSettings

      public ThreadModeSettings(int checkerThreadsNumber, int treeWalkerThreadsNumber)
      Creates an instance of a ThreadModeSettings record class.
      Parameters:
      checkerThreadsNumber - the value for the checkerThreadsNumber record component
      treeWalkerThreadsNumber - the value for the treeWalkerThreadsNumber record component
  • Method Details

    • resolveName

      public String resolveName(String name)
      Resolves the module name according to the thread settings.
      Parameters:
      name - The original module name.
      Returns:
      resolved module name.
      Throws:
      IllegalArgumentException - when name is Checker or TreeWalker
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • checkerThreadsNumber

      public int checkerThreadsNumber()
      Returns the value of the checkerThreadsNumber record component.
      Returns:
      the value of the checkerThreadsNumber record component
    • treeWalkerThreadsNumber

      public int treeWalkerThreadsNumber()
      Returns the value of the treeWalkerThreadsNumber record component.
      Returns:
      the value of the treeWalkerThreadsNumber record component