Package 

Class IntentBuilder


  • 
    public final class IntentBuilder
    
                        

    Class for building Intent matchers

    • Constructor Detail

      • IntentBuilder

        IntentBuilder()
    • Method Detail

      • any

         final Unit any()

        Matches any intent

      • hasAction

         final Unit hasAction(String action)

        Matches intent with given action

        Parameters:
        action - Action to be matched
      • hasAction

         final Unit hasAction(Matcher<String> action)

        Matches intent with given action

        Parameters:
        action - Matcher for action string
      • hasCategories

         final Unit hasCategories(String categories)

        Matches intent with given categories

        Parameters:
        categories - Categories to be matched
      • hasCategories

         final Unit hasCategories(Matcher<out Iterable<String>> categories)

        Matches intent with given categories

        Parameters:
        categories - Matcher for categories list
      • hasComponent

         final Unit hasComponent(String className)

        Matches intent which component has given class name

        Parameters:
        className - Class name to be matched in intent's component
      • hasComponent

         final Unit hasComponent(ComponentName component)

        Matches intent with given component

        Parameters:
        component - Component name to be matched
      • hasComponent

         final Unit hasComponent(Matcher<ComponentName> component)

        Matches intent with given component

        Parameters:
        component - Matcher for component name
      • hasData

         final Unit hasData(String uri)

        Matches intent with given data

        Parameters:
        uri - Uri to be matched
      • hasData

         final Unit hasData(Uri uri)

        Matches intent with given data

        Parameters:
        uri - Uri to be matched
      • hasData

         final Unit hasData(Matcher<Uri> uri)

        Matches intent with given data

        Parameters:
        uri - Matcher for the uri
      • hasData

         final Unit hasData(Function1<UriBuilder, Unit> function)

        Matches intent with given data

        Parameters:
        function - Builder for a uri to match
      • hasExtra

         final Unit hasExtra(String key, Object value)

        Matches intent with given extra

        Parameters:
        key - Extra key
        value - Extra value
      • hasExtra

         final Unit hasExtra(Matcher<String> key, Matcher<Object> value)

        Matches intent with given extra

        Parameters:
        key - Matcher for extra key
        value - Matcher for extra value
      • hasExtraWithKey

         final Unit hasExtraWithKey(Matcher<String> key)

        Matches intent with given extra key

        Parameters:
        key - Matcher for extra key
      • hasExtras

         final Unit hasExtras(Matcher<Bundle> extras)

        Matches intent with given extras

        Parameters:
        extras - Matched for extras bundle
      • hasExtras

         final Unit hasExtras(Function1<BundleBuilder, Unit> function)

        Matches intent with given extras

        Parameters:
        function - Builder for a bundle to match
      • hasFlag

         final Unit hasFlag(Integer flag)

        Matches intent with given flag

        Parameters:
        flag - Flag to be matched
      • hasFlags

         final Unit hasFlags(Integer flags)

        Matches intent with given flags

        Parameters:
        flags - Flags to be matched
      • hasFlags

         final Unit hasFlags(Integer flags)

        Matches intent with given flags

        Parameters:
        flags - Flags to be matched
      • hasType

         final Unit hasType(String type)

        Matches intent with given type

        Parameters:
        type - Type to match
      • hasType

         final Unit hasType(Matcher<String> type)

        Matches intent with given type

        Parameters:
        type - Matcher for type
      • hasPackage

         final Unit hasPackage(String packageName)

        Matches intent with given package

        Parameters:
        packageName - Package name to match
      • hasPackage

         final Unit hasPackage(Matcher<String> packageName)

        Matches intent with given package

        Parameters:
        packageName - Matcher for a package name
      • toPackage

         final Unit toPackage(String packageName)

        Matches intent which addresses to given package

        Parameters:
        packageName - Package name to match
      • withResult

         final Unit withResult(Function1<ActivityResultBuilder, Unit> function)

        Invoke this function if you want to set default result for intending intents

        Parameters:
        function - Builder for activity result