CursorMatchers
public
final
class
CursorMatchers
extends Object
java.lang.Object | |
↳ | android.support.test.espresso.matcher.CursorMatchers |
A collection of Hamcrest matchers that matches a data row in a Cursor
.
AdapterView
s that are backed by a Cursor
are very common. This class contains
Matcher
s that can be used together with onData(Matcher)
to match a data row in a Cursor
.
The
Matcher
s can only operate on a single data row of the cursor and Espresso internally
moves the Cursor
to the correct adapter position.
Summary
Nested classes | |
---|---|
class |
CursorMatchers.CursorMatcher
A |
Public methods | |
---|---|
static
CursorMatchers.CursorMatcher
|
withRowBlob(int columnIndex, Matcher<byte[]> valueMatcher)
Returns a matcher that matches a byte[] at a given column index in a |
static
CursorMatchers.CursorMatcher
|
withRowBlob(Matcher<String> columnPicker, Matcher<byte[]> valueMatcher)
Returns a matcher that matches a byte[] at a given column index in a |
static
CursorMatchers.CursorMatcher
|
withRowBlob(String columnName, Matcher<byte[]> valueMatcher)
Returns a matcher that matches a byte[] at a given column index in a |
static
CursorMatchers.CursorMatcher
|
withRowBlob(String columnName, byte[] value)
Returns a matcher that matches a byte[] at a given column index in a |
static
CursorMatchers.CursorMatcher
|
withRowBlob(int columnIndex, byte[] value)
Returns a matcher that matches a byte[] at a given column index in a |
static
CursorMatchers.CursorMatcher
|
withRowDouble(int columnIndex, Matcher<Double> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowDouble(String columnName, double value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowDouble(Matcher<String> columnNameMatcher, Matcher<Double> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowDouble(int columnIndex, double value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowDouble(String columnName, Matcher<Double> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowFloat(String columnName, Matcher<Float> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowFloat(Matcher<String> columnNameMatcher, Matcher<Float> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowFloat(String columnName, float value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowFloat(int columnIndex, Matcher<Float> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowFloat(int columnIndex, float value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowInt(String columnName, Matcher<Integer> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowInt(String columnName, int value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowInt(Matcher<String> columnNameMatcher, Matcher<Integer> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowInt(int columnIndex, int value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowInt(int columnIndex, Matcher<Integer> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowLong(String columnName, long value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowLong(int columnIndex, long value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowLong(Matcher<String> columnNameMatcher, Matcher<Long> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowLong(String columnName, Matcher<Long> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowLong(int columnIndex, Matcher<Long> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowShort(int columnIndex, Matcher<Short> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowShort(String columnName, short value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowShort(Matcher<String> columnNameMatcher, Matcher<Short> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowShort(String columnName, Matcher<Short> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowShort(int columnIndex, short value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowString(int columnIndex, Matcher<String> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowString(String columnName, Matcher<String> valueMatcher)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowString(String columnName, String value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowString(int columnIndex, String value)
Returns a matcher that matches a |
static
CursorMatchers.CursorMatcher
|
withRowString(Matcher<String> columnPicker, Matcher<String> valueMatcher)
Returns a matcher that matches a |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public methods
withRowBlob
CursorMatchers.CursorMatcher withRowBlob (int columnIndex, Matcher<byte[]> valueMatcher)
Returns a matcher that matches a byte[] at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a byte[]
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowBlob
CursorMatchers.CursorMatcher withRowBlob (Matcher<String> columnPicker, Matcher<byte[]> valueMatcher)
Returns a matcher that matches a byte[] at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnPicker |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a byte[]
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowBlob
CursorMatchers.CursorMatcher withRowBlob (String columnName, Matcher<byte[]> valueMatcher)
Returns a matcher that matches a byte[] at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a byte[]
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowBlob
CursorMatchers.CursorMatcher withRowBlob (String columnName, byte[] value)
Returns a matcher that matches a byte[] at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
byte : byte[] to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowBlob
CursorMatchers.CursorMatcher withRowBlob (int columnIndex, byte[] value)
Returns a matcher that matches a byte[] at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
byte : byte[] to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowDouble
CursorMatchers.CursorMatcher withRowDouble (int columnIndex, Matcher<Double> valueMatcher)
Returns a matcher that matches a Double
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a Double value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowDouble
CursorMatchers.CursorMatcher withRowDouble (String columnName, double value)
Returns a matcher that matches a Double
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
double : a double value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowDouble
CursorMatchers.CursorMatcher withRowDouble (Matcher<String> columnNameMatcher, Matcher<Double> valueMatcher)
Returns a matcher that matches a Double
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnNameMatcher |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a Double value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowDouble
CursorMatchers.CursorMatcher withRowDouble (int columnIndex, double value)
Returns a matcher that matches a Double
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
double : a double value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowDouble
CursorMatchers.CursorMatcher withRowDouble (String columnName, Matcher<Double> valueMatcher)
Returns a matcher that matches a Double
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a Double value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowFloat
CursorMatchers.CursorMatcher withRowFloat (String columnName, Matcher<Float> valueMatcher)
Returns a matcher that matches a Float
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a Float value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowFloat
CursorMatchers.CursorMatcher withRowFloat (Matcher<String> columnNameMatcher, Matcher<Float> valueMatcher)
Returns a matcher that matches a Float
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnNameMatcher |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a Float value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowFloat
CursorMatchers.CursorMatcher withRowFloat (String columnName, float value)
Returns a matcher that matches a Float
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
float : a float value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowFloat
CursorMatchers.CursorMatcher withRowFloat (int columnIndex, Matcher<Float> valueMatcher)
Returns a matcher that matches a Float
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a Float value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowFloat
CursorMatchers.CursorMatcher withRowFloat (int columnIndex, float value)
Returns a matcher that matches a Float
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
float : a float value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowInt
CursorMatchers.CursorMatcher withRowInt (String columnName, Matcher<Integer> valueMatcher)
Returns a matcher that matches a Integer
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a Integer value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowInt
CursorMatchers.CursorMatcher withRowInt (String columnName, int value)
Returns a matcher that matches a Integer
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
int : a int value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowInt
CursorMatchers.CursorMatcher withRowInt (Matcher<String> columnNameMatcher, Matcher<Integer> valueMatcher)
Returns a matcher that matches a Integer
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnNameMatcher |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a Integer value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowInt
CursorMatchers.CursorMatcher withRowInt (int columnIndex, int value)
Returns a matcher that matches a Integer
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
int : a int value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowInt
CursorMatchers.CursorMatcher withRowInt (int columnIndex, Matcher<Integer> valueMatcher)
Returns a matcher that matches a Integer
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a Integer value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowLong
CursorMatchers.CursorMatcher withRowLong (String columnName, long value)
Returns a matcher that matches a Long
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
long : a long value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowLong
CursorMatchers.CursorMatcher withRowLong (int columnIndex, long value)
Returns a matcher that matches a Long
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
long : a long value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowLong
CursorMatchers.CursorMatcher withRowLong (Matcher<String> columnNameMatcher, Matcher<Long> valueMatcher)
Returns a matcher that matches a Long
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnNameMatcher |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a Long value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowLong
CursorMatchers.CursorMatcher withRowLong (String columnName, Matcher<Long> valueMatcher)
Returns a matcher that matches a Long
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a Long value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowLong
CursorMatchers.CursorMatcher withRowLong (int columnIndex, Matcher<Long> valueMatcher)
Returns a matcher that matches a Long
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a Long value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowShort
CursorMatchers.CursorMatcher withRowShort (int columnIndex, Matcher<Short> valueMatcher)
Returns a matcher that matches a Short
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a Short value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowShort
CursorMatchers.CursorMatcher withRowShort (String columnName, short value)
Returns a matcher that matches a Short
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
short : a short value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowShort
CursorMatchers.CursorMatcher withRowShort (Matcher<String> columnNameMatcher, Matcher<Short> valueMatcher)
Returns a matcher that matches a Short
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnNameMatcher |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a Short value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowShort
CursorMatchers.CursorMatcher withRowShort (String columnName, Matcher<Short> valueMatcher)
Returns a matcher that matches a Short
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a Short value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowShort
CursorMatchers.CursorMatcher withRowShort (int columnIndex, short value)
Returns a matcher that matches a Short
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
short : a short value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowString
CursorMatchers.CursorMatcher withRowString (int columnIndex, Matcher<String> valueMatcher)
Returns a matcher that matches a String
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
valueMatcher |
Matcher : a Matcher
that matches a String value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowString
CursorMatchers.CursorMatcher withRowString (String columnName, Matcher<String> valueMatcher)
Returns a matcher that matches a String
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
valueMatcher |
Matcher : a Matcher
that matches a String value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowString
CursorMatchers.CursorMatcher withRowString (String columnName, String value)
Returns a matcher that matches a String
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnName |
String : as a String |
value |
String : a String value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowString
CursorMatchers.CursorMatcher withRowString (int columnIndex, String value)
Returns a matcher that matches a String
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnIndex |
int : int column index |
value |
String : a String value to match
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
withRowString
CursorMatchers.CursorMatcher withRowString (Matcher<String> columnPicker, Matcher<String> valueMatcher)
Returns a matcher that matches a String
value at a given column index in a Cursor
s data row.
Parameters | |
---|---|
columnPicker |
Matcher : as a Matcher
of String |
valueMatcher |
Matcher : a Matcher
that matches a String value
|
Returns | |
---|---|
CursorMatchers.CursorMatcher |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.