Class FuzzyMethodContract

java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember<MethodInfo>
com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract
All Implemented Interfaces:
AbstractFuzzyMatcher<MethodInfo>

public class FuzzyMethodContract extends AbstractFuzzyMember<MethodInfo>
Represents a contract for matching methods or constructors.
  • Method Details

    • newBuilder

      public static FuzzyMethodContract.Builder newBuilder()
      Return a method contract builder.
      Returns:
      Method contract builder.
    • getReturnMatcher

      public AbstractFuzzyMatcher<Class<?>> getReturnMatcher()
      Retrieve the class matcher for the return type.
      Returns:
      Class matcher for the return type.
    • getParamMatchers

      public com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getParamMatchers()
      Retrieve an immutable list of every parameter matcher for this method.
      Returns:
      Immutable list of every parameter matcher.
    • getExceptionMatchers

      public List<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getExceptionMatchers()
      Retrieve an immutable list of every exception matcher for this method.
      Returns:
      Immutable list of every exception matcher.
    • getParamCount

      public Integer getParamCount()
      Retrieve the expected parameter count for this method.
      Returns:
      Expected parameter count, or NULL if anyting goes.
    • isMatch

      public boolean isMatch(MethodInfo value, Object parent)
      Description copied from interface: AbstractFuzzyMatcher
      Determine if the given value is a match.
      Specified by:
      isMatch in interface AbstractFuzzyMatcher<MethodInfo>
      Overrides:
      isMatch in class AbstractFuzzyMember<MethodInfo>
      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.
    • getKeyValueView

      protected Map<String,Object> getKeyValueView()
      Description copied from class: AbstractFuzzyMember
      Generate a view of this matcher as a key-value map.

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

      Overrides:
      getKeyValueView in class AbstractFuzzyMember<MethodInfo>
      Returns:
      A modifiable key-value view.