Class SerializableMatchers
- java.lang.Object
-
- org.apache.beam.sdk.testing.SerializableMatchers
-
- All Implemented Interfaces:
java.io.Serializable
public class SerializableMatchers extends java.lang.Object implements java.io.Serializable
Static class for building and usingSerializableMatcher
instances.Most matchers are wrappers for hamcrest's
Matchers
. Please be familiar with the documentation there. Values retained by aSerializableMatcher
are required to be serializable, either via Java serialization or via a providedCoder
.The following matchers are novel to Apache Beam:
kvWithKey(K)
for matching just the key of aKV
.kvWithValue(V)
for matching just the value of aKV
.kv(org.apache.beam.sdk.testing.SerializableMatcher<? super K>, org.apache.beam.sdk.testing.SerializableMatcher<? super V>)
for matching the key and value of aKV
.
For example, to match a group from
GroupByKey
, which has typeKV<K, Iterable<V>>
for someK
andV
and where the order of the iterable is undefined, use a matcher likekv(equalTo("some key"), containsInAnyOrder(1, 2, 3))
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SerializableMatchers.SerializableSupplier<T>
Supplies values of typeT
, and is serializable.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> SerializableMatcher<T>
allOf(java.lang.Iterable<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.allOf(Iterable)
.static <T> SerializableMatcher<T>
allOf(SerializableMatcher<T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.allOf(Matcher[])
.static <T> SerializableMatcher<T>
anyOf(java.lang.Iterable<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.anyOf(Iterable)
.static <T> SerializableMatcher<T>
anyOf(SerializableMatcher<T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.anyOf(Matcher[])
.static SerializableMatcher<java.lang.Object>
anything()
ASerializableMatcher
with identical criteria toMatchers.anything()
.static <T> SerializableMatcher<T[]>
arrayContaining(java.util.List<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(List)
.static <T> SerializableMatcher<T[]>
arrayContaining(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(Object[])
.static <T> SerializableMatcher<T[]>
arrayContaining(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(Matcher[])
.static <T extends java.io.Serializable>
SerializableMatcher<T[]>arrayContaining(T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(Object[])
.static <T> SerializableMatcher<T[]>
arrayContainingInAnyOrder(java.util.Collection<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Collection)
.static <T> SerializableMatcher<T[]>
arrayContainingInAnyOrder(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Object[])
.static <T> SerializableMatcher<T[]>
arrayContainingInAnyOrder(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Matcher[])
.static <T extends java.io.Serializable>
SerializableMatcher<T[]>arrayContainingInAnyOrder(T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Object[])
.static <T> SerializableMatcher<T[]>
arrayWithSize(int size)
ASerializableMatcher
with identical criteria toMatchers.arrayWithSize(int)
.static <T> SerializableMatcher<T[]>
arrayWithSize(SerializableMatcher<? super java.lang.Integer> sizeMatcher)
ASerializableMatcher
with identical criteria toMatchers.arrayWithSize(Matcher)
.static SerializableMatcher<java.lang.Double>
closeTo(double target, double error)
ASerializableMatcher
with identical criteria toMatchers.closeTo(double,double)
.static <T extends java.io.Serializable>
SerializableMatcher<java.lang.Iterable<? extends T>>contains(java.util.List<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.contains(List)
.static <T> SerializableMatcher<java.lang.Iterable<? extends T>>
contains(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.contains(Object[])
.static <T> SerializableMatcher<java.lang.Iterable<? extends T>>
contains(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.contains(Matcher[])
.static <T extends java.io.Serializable>
SerializableMatcher<java.lang.Iterable<? extends T>>contains(T... items)
ASerializableMatcher
with identical criteria toMatchers.contains(Object[])
.static <T> SerializableMatcher<java.lang.Iterable<? extends T>>
containsInAnyOrder(java.util.Collection<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Collection)
.static <T> SerializableMatcher<java.lang.Iterable<? extends T>>
containsInAnyOrder(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Object[])
.static <T> SerializableMatcher<java.lang.Iterable<? extends T>>
containsInAnyOrder(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Matcher[])
.static <T extends java.io.Serializable>
SerializableMatcher<java.lang.Iterable<? extends T>>containsInAnyOrder(T... items)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Object[])
.static SerializableMatcher<java.lang.String>
containsString(java.lang.String substring)
ASerializableMatcher
with identical criteria toMatchers.containsString(java.lang.String)
.static <T> SerializableMatcher<java.util.Collection<? extends T>>
empty()
ASerializableMatcher
with identical criteria toMatchers.empty()
.static <T> SerializableMatcher<T[]>
emptyArray()
ASerializableMatcher
with identical criteria toMatchers.emptyArray()
.static <T> SerializableMatcher<java.lang.Iterable<? extends T>>
emptyIterable()
ASerializableMatcher
with identical criteria toMatchers.emptyIterable()
.static SerializableMatcher<java.lang.String>
endsWith(java.lang.String substring)
ASerializableMatcher
with identical criteria toMatchers.endsWith(java.lang.String)
.static <T> SerializableMatcher<T>
equalTo(Coder<T> coder, T expected)
ASerializableMatcher
with identical criteria toMatchers.equalTo(Object)
.static <T extends java.io.Serializable>
SerializableMatcher<T>equalTo(T expected)
ASerializableMatcher
with identical criteria toMatchers.equalTo(Object)
.static <T> SerializableMatcher<T>
fromSupplier(SerializableMatchers.SerializableSupplier<org.hamcrest.Matcher<T>> supplier)
Constructs aSerializableMatcher
from a non-serializableMatcher
via indirection throughSerializableMatchers.SerializableSupplier
.static <T extends java.lang.Comparable<T> & java.io.Serializable>
SerializableMatcher<T>greaterThan(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThan(Comparable)
.static <T extends java.lang.Comparable<T> & java.io.Serializable>
SerializableMatcher<T>greaterThan(T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThan(Comparable)
.static <T extends java.lang.Comparable<T> & java.io.Serializable>
SerializableMatcher<T>greaterThanOrEqualTo(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThanOrEqualTo(Comparable)
.static <T extends java.lang.Comparable<T>>
SerializableMatcher<T>greaterThanOrEqualTo(T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThanOrEqualTo(Comparable)
.static <T> SerializableMatcher<java.lang.Iterable<? super T>>
hasItem(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.hasItem(Object)
.static <T> SerializableMatcher<java.lang.Iterable<? super T>>
hasItem(SerializableMatcher<? super T> matcher)
ASerializableMatcher
with identical criteria toMatchers.hasItem(Matcher)
.static <T extends java.io.Serializable>
SerializableMatcher<java.lang.Iterable<? super T>>hasItem(T target)
ASerializableMatcher
with identical criteria toMatchers.hasItem(Object)
.static <T> SerializableMatcher<java.util.Collection<? extends T>>
hasSize(int size)
ASerializableMatcher
with identical criteria toMatchers.hasSize(int)
.static <T> SerializableMatcher<java.util.Collection<? extends T>>
hasSize(SerializableMatcher<? super java.lang.Integer> sizeMatcher)
ASerializableMatcher
with identical criteria toMatchers.hasSize(Matcher)
.static <T extends java.io.Serializable>
SerializableMatcher<T>isIn(java.util.Collection<T> collection)
ASerializableMatcher
with identical criteria toMatchers.isIn(Collection)
.static <T> SerializableMatcher<T>
isIn(Coder<T> coder, java.util.Collection<T> collection)
ASerializableMatcher
with identical criteria toMatchers.isIn(Collection)
.static <T> SerializableMatcher<T>
isIn(Coder<T> coder, T[] items)
ASerializableMatcher
with identical criteria toMatchers.isIn(Object[])
.static <T extends java.io.Serializable>
SerializableMatcher<T>isIn(T[] items)
ASerializableMatcher
with identical criteria toMatchers.isIn(Object[])
.static <T> SerializableMatcher<T>
isOneOf(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.isOneOf(T...)
.static <T extends java.io.Serializable>
SerializableMatcher<T>isOneOf(T... elems)
ASerializableMatcher
with identical criteria toMatchers.isOneOf(T...)
.static <T> SerializableMatcher<java.lang.Iterable<T>>
iterableWithSize(int size)
ASerializableMatcher
with identical criteria toMatchers.iterableWithSize(int)
.static <T> SerializableMatcher<java.lang.Iterable<T>>
iterableWithSize(SerializableMatcher<? super java.lang.Integer> sizeMatcher)
ASerializableMatcher
with identical criteria toMatchers.iterableWithSize(Matcher)
.static <K,V>
SerializableMatcher<KV<? extends K,? extends V>>kv(SerializableMatcher<? super K> keyMatcher, SerializableMatcher<? super V> valueMatcher)
ASerializableMatcher
that matches anyKV
with matching key and value.static <K extends java.io.Serializable,V>
SerializableMatcher<KV<? extends K,? extends V>>kvWithKey(K key)
ASerializableMatcher
that matches anyKV
with the specified key.static <K,V>
SerializableMatcher<KV<? extends K,? extends V>>kvWithKey(Coder<K> coder, K key)
ASerializableMatcher
that matches anyKV
with the specified key.static <K,V>
SerializableMatcher<KV<? extends K,? extends V>>kvWithKey(SerializableMatcher<? super K> keyMatcher)
ASerializableMatcher
that matches anyKV
with matching key.static <K,V>
SerializableMatcher<KV<? extends K,? extends V>>kvWithValue(Coder<V> coder, V value)
ASerializableMatcher
that matches anyKV
with the specified value.static <K,V>
SerializableMatcher<KV<? extends K,? extends V>>kvWithValue(SerializableMatcher<? super V> valueMatcher)
ASerializableMatcher
that matches anyKV
with matching value.static <K,V extends java.io.Serializable>
SerializableMatcher<KV<? extends K,? extends V>>kvWithValue(V value)
ASerializableMatcher
that matches anyKV
with the specified value.static <T extends java.lang.Comparable<T>>
SerializableMatcher<T>lessThan(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.lessThan(Comparable)
.static <T extends java.lang.Comparable<T> & java.io.Serializable>
SerializableMatcher<T>lessThan(T target)
ASerializableMatcher
with identical criteria toMatchers.lessThan(Comparable)
.static <T extends java.lang.Comparable<T>>
SerializableMatcher<T>lessThanOrEqualTo(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.lessThanOrEqualTo(Comparable)
.static <T extends java.lang.Comparable<T> & java.io.Serializable>
SerializableMatcher<T>lessThanOrEqualTo(T target)
ASerializableMatcher
with identical criteria toMatchers.lessThanOrEqualTo(Comparable)
.static <T> SerializableMatcher<T>
not(SerializableMatcher<T> matcher)
ASerializableMatcher
with identical criteria toMatchers.not(org.hamcrest.Matcher<T>)
.static SerializableMatcher<java.lang.Object>
nullValue()
ASerializableMatcher
with identical criteria toMatchers.nullValue()
.static SerializableMatcher<java.lang.String>
startsWith(java.lang.String substring)
ASerializableMatcher
with identical criteria toMatchers.startsWith(java.lang.String)
.
-
-
-
Method Detail
-
allOf
public static <T> SerializableMatcher<T> allOf(java.lang.Iterable<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.allOf(Iterable)
.
-
allOf
@SafeVarargs public static <T> SerializableMatcher<T> allOf(SerializableMatcher<T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.allOf(Matcher[])
.
-
anyOf
public static <T> SerializableMatcher<T> anyOf(java.lang.Iterable<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.anyOf(Iterable)
.
-
anyOf
@SafeVarargs public static <T> SerializableMatcher<T> anyOf(SerializableMatcher<T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.anyOf(Matcher[])
.
-
anything
public static SerializableMatcher<java.lang.Object> anything()
ASerializableMatcher
with identical criteria toMatchers.anything()
.
-
arrayContaining
@SafeVarargs public static <T extends java.io.Serializable> SerializableMatcher<T[]> arrayContaining(T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(Object[])
.
-
arrayContaining
@SafeVarargs public static <T> SerializableMatcher<T[]> arrayContaining(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(Object[])
.The items of type
T
will be serialized using the providedCoder
. They are explicitly not required or expected to be serializable via Java serialization.
-
arrayContaining
@SafeVarargs public static <T> SerializableMatcher<T[]> arrayContaining(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(Matcher[])
.
-
arrayContaining
public static <T> SerializableMatcher<T[]> arrayContaining(java.util.List<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContaining(List)
.
-
arrayContainingInAnyOrder
@SafeVarargs public static <T extends java.io.Serializable> SerializableMatcher<T[]> arrayContainingInAnyOrder(T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Object[])
.
-
arrayContainingInAnyOrder
@SafeVarargs public static <T> SerializableMatcher<T[]> arrayContainingInAnyOrder(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Object[])
.The items of type
T
will be serialized using the providedCoder
. They are explicitly not required or expected to be serializable via Java serialization.
-
arrayContainingInAnyOrder
@SafeVarargs public static <T> SerializableMatcher<T[]> arrayContainingInAnyOrder(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Matcher[])
.
-
arrayContainingInAnyOrder
public static <T> SerializableMatcher<T[]> arrayContainingInAnyOrder(java.util.Collection<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.arrayContainingInAnyOrder(Collection)
.
-
arrayWithSize
public static <T> SerializableMatcher<T[]> arrayWithSize(int size)
ASerializableMatcher
with identical criteria toMatchers.arrayWithSize(int)
.
-
arrayWithSize
public static <T> SerializableMatcher<T[]> arrayWithSize(SerializableMatcher<? super java.lang.Integer> sizeMatcher)
ASerializableMatcher
with identical criteria toMatchers.arrayWithSize(Matcher)
.
-
closeTo
public static SerializableMatcher<java.lang.Double> closeTo(double target, double error)
ASerializableMatcher
with identical criteria toMatchers.closeTo(double,double)
.
-
contains
@SafeVarargs public static <T extends java.io.Serializable> SerializableMatcher<java.lang.Iterable<? extends T>> contains(T... items)
ASerializableMatcher
with identical criteria toMatchers.contains(Object[])
.
-
contains
@SafeVarargs public static <T> SerializableMatcher<java.lang.Iterable<? extends T>> contains(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.contains(Object[])
.The items of type
T
will be serialized using the providedCoder
. They are explicitly not required or expected to be serializable via Java serialization.
-
contains
@SafeVarargs public static <T> SerializableMatcher<java.lang.Iterable<? extends T>> contains(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.contains(Matcher[])
.
-
contains
public static <T extends java.io.Serializable> SerializableMatcher<java.lang.Iterable<? extends T>> contains(java.util.List<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.contains(List)
.
-
containsInAnyOrder
@SafeVarargs public static <T extends java.io.Serializable> SerializableMatcher<java.lang.Iterable<? extends T>> containsInAnyOrder(T... items)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Object[])
.
-
containsInAnyOrder
@SafeVarargs public static <T> SerializableMatcher<java.lang.Iterable<? extends T>> containsInAnyOrder(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Object[])
.The items of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
containsInAnyOrder
@SafeVarargs public static <T> SerializableMatcher<java.lang.Iterable<? extends T>> containsInAnyOrder(SerializableMatcher<? super T>... matchers)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Matcher[])
.
-
containsInAnyOrder
public static <T> SerializableMatcher<java.lang.Iterable<? extends T>> containsInAnyOrder(java.util.Collection<SerializableMatcher<? super T>> serializableMatchers)
ASerializableMatcher
with identical criteria toMatchers.containsInAnyOrder(Collection)
.
-
containsString
public static SerializableMatcher<java.lang.String> containsString(java.lang.String substring)
ASerializableMatcher
with identical criteria toMatchers.containsString(java.lang.String)
.
-
empty
public static <T> SerializableMatcher<java.util.Collection<? extends T>> empty()
ASerializableMatcher
with identical criteria toMatchers.empty()
.
-
emptyArray
public static <T> SerializableMatcher<T[]> emptyArray()
ASerializableMatcher
with identical criteria toMatchers.emptyArray()
.
-
emptyIterable
public static <T> SerializableMatcher<java.lang.Iterable<? extends T>> emptyIterable()
ASerializableMatcher
with identical criteria toMatchers.emptyIterable()
.
-
endsWith
public static SerializableMatcher<java.lang.String> endsWith(java.lang.String substring)
ASerializableMatcher
with identical criteria toMatchers.endsWith(java.lang.String)
.
-
equalTo
public static <T extends java.io.Serializable> SerializableMatcher<T> equalTo(T expected)
ASerializableMatcher
with identical criteria toMatchers.equalTo(Object)
.
-
equalTo
public static <T> SerializableMatcher<T> equalTo(Coder<T> coder, T expected)
ASerializableMatcher
with identical criteria toMatchers.equalTo(Object)
.The expected value of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
greaterThan
public static <T extends java.lang.Comparable<T> & java.io.Serializable> SerializableMatcher<T> greaterThan(T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThan(Comparable)
.
-
greaterThan
public static <T extends java.lang.Comparable<T> & java.io.Serializable> SerializableMatcher<T> greaterThan(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThan(Comparable)
.The target value of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
greaterThanOrEqualTo
public static <T extends java.lang.Comparable<T>> SerializableMatcher<T> greaterThanOrEqualTo(T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThanOrEqualTo(Comparable)
.
-
greaterThanOrEqualTo
public static <T extends java.lang.Comparable<T> & java.io.Serializable> SerializableMatcher<T> greaterThanOrEqualTo(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.greaterThanOrEqualTo(Comparable)
.The target value of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
hasItem
public static <T extends java.io.Serializable> SerializableMatcher<java.lang.Iterable<? super T>> hasItem(T target)
ASerializableMatcher
with identical criteria toMatchers.hasItem(Object)
.
-
hasItem
public static <T> SerializableMatcher<java.lang.Iterable<? super T>> hasItem(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.hasItem(Object)
.The item of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
hasItem
public static <T> SerializableMatcher<java.lang.Iterable<? super T>> hasItem(SerializableMatcher<? super T> matcher)
ASerializableMatcher
with identical criteria toMatchers.hasItem(Matcher)
.
-
hasSize
public static <T> SerializableMatcher<java.util.Collection<? extends T>> hasSize(int size)
ASerializableMatcher
with identical criteria toMatchers.hasSize(int)
.
-
hasSize
public static <T> SerializableMatcher<java.util.Collection<? extends T>> hasSize(SerializableMatcher<? super java.lang.Integer> sizeMatcher)
ASerializableMatcher
with identical criteria toMatchers.hasSize(Matcher)
.
-
iterableWithSize
public static <T> SerializableMatcher<java.lang.Iterable<T>> iterableWithSize(int size)
ASerializableMatcher
with identical criteria toMatchers.iterableWithSize(int)
.
-
iterableWithSize
public static <T> SerializableMatcher<java.lang.Iterable<T>> iterableWithSize(SerializableMatcher<? super java.lang.Integer> sizeMatcher)
ASerializableMatcher
with identical criteria toMatchers.iterableWithSize(Matcher)
.
-
isIn
public static <T extends java.io.Serializable> SerializableMatcher<T> isIn(java.util.Collection<T> collection)
ASerializableMatcher
with identical criteria toMatchers.isIn(Collection)
.
-
isIn
public static <T> SerializableMatcher<T> isIn(Coder<T> coder, java.util.Collection<T> collection)
ASerializableMatcher
with identical criteria toMatchers.isIn(Collection)
.The items of type
T
will be serialized using the providedCoder
. They are explicitly not required or expected to be serializable via Java serialization.
-
isIn
public static <T extends java.io.Serializable> SerializableMatcher<T> isIn(T[] items)
ASerializableMatcher
with identical criteria toMatchers.isIn(Object[])
.
-
isIn
public static <T> SerializableMatcher<T> isIn(Coder<T> coder, T[] items)
ASerializableMatcher
with identical criteria toMatchers.isIn(Object[])
.The items of type
T
will be serialized using the providedCoder
. They are explicitly not required or expected to be serializable via Java serialization.
-
isOneOf
@SafeVarargs public static <T extends java.io.Serializable> SerializableMatcher<T> isOneOf(T... elems)
ASerializableMatcher
with identical criteria toMatchers.isOneOf(T...)
.
-
isOneOf
@SafeVarargs public static <T> SerializableMatcher<T> isOneOf(Coder<T> coder, T... items)
ASerializableMatcher
with identical criteria toMatchers.isOneOf(T...)
.The items of type
T
will be serialized using the providedCoder
. They are explicitly not required or expected to be serializable via Java serialization.
-
kvWithKey
public static <K extends java.io.Serializable,V> SerializableMatcher<KV<? extends K,? extends V>> kvWithKey(K key)
ASerializableMatcher
that matches anyKV
with the specified key.
-
kvWithKey
public static <K,V> SerializableMatcher<KV<? extends K,? extends V>> kvWithKey(Coder<K> coder, K key)
ASerializableMatcher
that matches anyKV
with the specified key.The key of type
K
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
kvWithKey
public static <K,V> SerializableMatcher<KV<? extends K,? extends V>> kvWithKey(SerializableMatcher<? super K> keyMatcher)
ASerializableMatcher
that matches anyKV
with matching key.
-
kvWithValue
public static <K,V extends java.io.Serializable> SerializableMatcher<KV<? extends K,? extends V>> kvWithValue(V value)
ASerializableMatcher
that matches anyKV
with the specified value.
-
kvWithValue
public static <K,V> SerializableMatcher<KV<? extends K,? extends V>> kvWithValue(Coder<V> coder, V value)
ASerializableMatcher
that matches anyKV
with the specified value.The value of type
V
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
kvWithValue
public static <K,V> SerializableMatcher<KV<? extends K,? extends V>> kvWithValue(SerializableMatcher<? super V> valueMatcher)
ASerializableMatcher
that matches anyKV
with matching value.
-
kv
public static <K,V> SerializableMatcher<KV<? extends K,? extends V>> kv(SerializableMatcher<? super K> keyMatcher, SerializableMatcher<? super V> valueMatcher)
ASerializableMatcher
that matches anyKV
with matching key and value.
-
lessThan
public static <T extends java.lang.Comparable<T> & java.io.Serializable> SerializableMatcher<T> lessThan(T target)
ASerializableMatcher
with identical criteria toMatchers.lessThan(Comparable)
.
-
lessThan
public static <T extends java.lang.Comparable<T>> SerializableMatcher<T> lessThan(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.lessThan(Comparable)
.The target value of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
lessThanOrEqualTo
public static <T extends java.lang.Comparable<T> & java.io.Serializable> SerializableMatcher<T> lessThanOrEqualTo(T target)
ASerializableMatcher
with identical criteria toMatchers.lessThanOrEqualTo(Comparable)
.
-
lessThanOrEqualTo
public static <T extends java.lang.Comparable<T>> SerializableMatcher<T> lessThanOrEqualTo(Coder<T> coder, T target)
ASerializableMatcher
with identical criteria toMatchers.lessThanOrEqualTo(Comparable)
.The target value of type
T
will be serialized using the providedCoder
. It is explicitly not required or expected to be serializable via Java serialization.
-
not
public static <T> SerializableMatcher<T> not(SerializableMatcher<T> matcher)
ASerializableMatcher
with identical criteria toMatchers.not(org.hamcrest.Matcher<T>)
.
-
nullValue
public static SerializableMatcher<java.lang.Object> nullValue()
ASerializableMatcher
with identical criteria toMatchers.nullValue()
.
-
startsWith
public static SerializableMatcher<java.lang.String> startsWith(java.lang.String substring)
ASerializableMatcher
with identical criteria toMatchers.startsWith(java.lang.String)
.
-
fromSupplier
public static <T> SerializableMatcher<T> fromSupplier(SerializableMatchers.SerializableSupplier<org.hamcrest.Matcher<T>> supplier)
Constructs aSerializableMatcher
from a non-serializableMatcher
via indirection throughSerializableMatchers.SerializableSupplier
.To wrap a
Matcher
which is not serializable, provide aSerializableMatchers.SerializableSupplier
with aSerializableMatchers.SerializableSupplier.get()
method that returns a fresh instance of theMatcher
desired. The resultingSerializableMatcher
will behave according to theMatcher
returned byget()
when it is invoked during matching (which may occur on another machine).return fromSupplier(new SerializableSupplier<Matcher<T>>() { * @Override public Matcher<T> get() { return new MyMatcherForT(); } });
-
-