Class AbstractFuzzyMember<T extends Member>

java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember<T>
Type Parameters:
T - - type that it matches.
All Implemented Interfaces:
AbstractFuzzyMatcher<T>
Direct Known Subclasses:
FuzzyFieldContract, FuzzyMethodContract

public abstract class AbstractFuzzyMember<T extends Member> extends Object implements AbstractFuzzyMatcher<T>
Represents a matcher that matches members.
  • Field Details

    • modifiersRequired

      protected int modifiersRequired
    • modifiersBanned

      protected int modifiersBanned
    • nameRegex

      protected Pattern nameRegex
    • declaringMatcher

      protected AbstractFuzzyMatcher<Class<?>> declaringMatcher
    • sealed

      protected transient boolean sealed
      Whether this contract can be modified.
  • Constructor Details

    • AbstractFuzzyMember

      protected AbstractFuzzyMember()
    • AbstractFuzzyMember

      protected AbstractFuzzyMember(AbstractFuzzyMember<T> other)
  • Method Details

    • prepareBuild

      protected void prepareBuild()
      Called before a builder is building a member and copying its state.

      Use this to prepare any special values.

    • getModifiersRequired

      public int getModifiersRequired()
      Retrieve a bit field of every Modifier that is required for the member to match.
      Returns:
      A required modifier bit field.
    • getModifiersBanned

      public int getModifiersBanned()
      Retrieve a bit field of every Modifier that must not be present for the member to match.
      Returns:
      A banned modifier bit field.
    • getNameRegex

      public Pattern getNameRegex()
      Retrieve the regular expression pattern that is used to match the name of a member.
      Returns:
      The regex matching a name, or NULL if everything matches.
    • getDeclaringMatcher

      public AbstractFuzzyMatcher<Class<?>> getDeclaringMatcher()
      Retrieve a class matcher for the declaring class of the member.
      Returns:
      An object matching the declaring class.
    • isMatch

      public boolean isMatch(T value, Object parent)
      Description copied from interface: AbstractFuzzyMatcher
      Determine if the given value is a match.
      Specified by:
      isMatch in interface AbstractFuzzyMatcher<T extends Member>
      Parameters:
      value - - the value to match.
      parent - - the parent container, or NULL if this value is the root.
      Returns:
      TRUE if it is a match, FALSE otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKeyValueView

      protected Map<String,Object> getKeyValueView()
      Generate a view of this matcher as a key-value map.

      Used by toString() to print a representation of this object.

      Returns:
      A modifiable key-value view.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object