IntentBuilder

public final class IntentBuilder

Class for building Intent matchers

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
public final Unit any()

Matches any intent

Link copied to clipboard
public final Matcher<Intent> getMatcher()
Link copied to clipboard
Link copied to clipboard
public final Unit hasAction(String action)
public final Unit hasAction(Matcher<String> action)

Matches intent with given action

Link copied to clipboard
public final Unit hasCategories(String categories)
public final Unit hasCategories(Matcher<? extends Iterable<String>> categories)

Matches intent with given categories

Link copied to clipboard
public final Unit hasComponent(ComponentName component)
public final Unit hasComponent(Function1<ComponentNameBuilder, Unit> function)
public final Unit hasComponent(Matcher<ComponentName> component)

Matches intent with given component

public final Unit hasComponent(String className)

Matches intent which component has given class name

Link copied to clipboard
public final Unit hasData(Uri uri)
public final Unit hasData(Function1<UriBuilder, Unit> function)
public final Unit hasData(String uri)
public final Unit hasData(Matcher<Uri> uri)

Matches intent with given data

Link copied to clipboard
public final Unit hasExtra(String key, Object value)
public final Unit hasExtra(Matcher<String> key, Matcher<Object> value)

Matches intent with given extra

Link copied to clipboard
public final Unit hasExtras(Function1<BundleBuilder, Unit> function)
public final Unit hasExtras(Matcher<Bundle> extras)

Matches intent with given extras

Link copied to clipboard
public final Unit hasExtraWithKey(String key)
public final Unit hasExtraWithKey(Matcher<String> key)

Matches intent with given extra key

Link copied to clipboard
public final Unit hasFlag(Integer flag)

Matches intent with given flag

Link copied to clipboard
public final Unit hasFlags(Integer flags)
public final Unit hasFlags(Integer flags)

Matches intent with given flags

Link copied to clipboard
public final Unit hasPackage(String packageName)
public final Unit hasPackage(Matcher<String> packageName)

Matches intent with given package

Link copied to clipboard
public final Unit hasType(String type)
public final Unit hasType(Matcher<String> type)

Matches intent with given type

Link copied to clipboard
public final Unit isInternal()

Matches any internal intent

Link copied to clipboard
public final Unit toPackage(String packageName)

Matches intent which addresses to given package

Link copied to clipboard
public final Unit withResult(Function1<ActivityResultBuilder, Unit> function)

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