Interface Matchers


public interface Matchers
Utility interface for constructing common Matchers
  • Method Details

    • name

      static Matcher name(String name)
      Creates a Matcher that matches InjectionTargets by their names
      Parameters:
      name - The name to match
      Returns:
      A new Matcher
    • annotation

      static Matcher annotation(Class<? extends Annotation> type)
      Creates a Matcher that matches InjectionTargets with the given annotation
      Parameters:
      type - The annotation type to match
      Returns:
      A new Matcher
    • type

      static Matcher type(Type type)
      Creates a Matcher that matches InjectionTargets with the given type, based on assignment rules. For example, if the given type is Object and the injection target type is Integer, this matcher will return true, since Integer can be assigned to Object. For an exact type match, use exactType(Type).
      Parameters:
      type - The type to match
      Returns:
      A new Matcher
    • exactType

      static Matcher exactType(Type type)
      Creates a Matcher tht matches InjectionTarget with given type, based on exact type equality. For example, if the given type is Object nd the injection target type is Integer, this matcher will return false, since Integer does not equal Object. For a type match based on assignment rules, use type(Type).
      Parameters:
      type - The type to match
      Returns:
      A new Matcher
    • type

      static Matcher type(honeyroasted.jype.type.JType type)
      Creates a Matcher that matches InjectionTargets with the given type, based on assignment rules. For example, if the given type is Object and the given type is Integer, this matcher will return true, since Integer can be assigned to Object. For an exact type match, use exactType(JType).
      Parameters:
      type - The type to match
      Returns:
      A new Matcher
    • exactType

      static Matcher exactType(honeyroasted.jype.type.JType type)
      Creates a Matcher tht matches InjectionTarget with given type, based on exact type equality. For example, if the given type is Object nd the injection target type is Integer, this matcher will return false, since Integer does not equal Object. For a type match based on assignment rules, use type(JType).
      Parameters:
      type - The type to match
      Returns:
      A new Matcher
    • type

      static Matcher type(honeyroasted.jype.system.resolver.reflection.JTypeToken<?> token)
      Creates a Matcher that matches InjectionTargets with the given type, based on assignment rules. For example, if the given type is Object and the given type is Integer, this matcher will return true, since Integer can be assigned to Object. For an exact type match, use exactType(JTypeToken).
      Parameters:
      token - The type to match
      Returns:
      A new Matcher
    • exactType

      static Matcher exactType(honeyroasted.jype.system.resolver.reflection.JTypeToken<?> token)
      Creates a Matcher tht matches InjectionTarget with given type, based on exact type equality. For example, if the given type is Object nd the injection target type is Integer, this matcher will return false, since Integer does not equal Object. For a type match based on assignment rules, use type(JTypeToken).
      Parameters:
      token - The type to match
      Returns:
      A new Matcher