Package: groovy.org.codenarc.util

## [Groovy] Class ModifiersUtil

- groovy.org.codenarc.util.ModifiersUtil

- Provide static utility methods for parsing AST member modifiers, e.g. public/protected/private, static, final, etc.

  Authors:
    Chris Mair

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static boolean` | `matchesAnyModifiers(Integer actualModifiers, List<Integer> expectedModifiersList)`
    `` | `static boolean` | `matchesModifiers(Integer actualModifiers, Integer expectedModifiers)` Return true only if the actualModifiers int value contains all of the bits (enabled) from the expectedModifiers
    `` | `static int` | `parseModifiers(String modifiersString)` Parse a group of whitespace-delimited modifier names
    `` | `static List<Integer>` | `parseModifiersList(String modifiersString)` Parse comma-separated list of modifier groups

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### static boolean matchesAnyModifiers(Integer actualModifiers, List<Integer> expectedModifiersList)

    - #### static boolean matchesModifiers(Integer actualModifiers, Integer expectedModifiers)

      Return true only if the actualModifiers int value contains all of the bits (enabled) from the expectedModifiers

      Parameters:
        `actualModifiers` - - the full actual modifiers; an int value of the OR-ed modifiers (values from Opcodes)
        `expectedModifiers` - - the modifiers to check against; an int value of the OR-ed modifiers (values from Opcodes)
      Returns:
        true only if the actualModifiers contains all of the bits (enabled) from the expectedModifiers

    - #### static int parseModifiers(String modifiersString)

      Parse a group of whitespace-delimited modifier names

      Parameters:
        `modifiersString` - - a group of whitespace-delimited modifier names
      Returns:
        the int value of the OR-ed modifiers (values from Opcodes)

    - #### static List<Integer> parseModifiersList(String modifiersString)

      Parse comma-separated list of modifier groups

      Parameters:
        `modifiersString` - - comma-separated list of modifier groups; each group is a list of whitespace-delimited modifier names; e.g. "public, protected static, protected final"
      Returns:
        a List<Integer> of the modifiers, one int value for each group (separated by commas)