Package org.infinispan.stream
Class StreamMarshalling
java.lang.Object
org.infinispan.stream.StreamMarshalling
Static factory class containing methods that will provide marshallable instances for very common use cases.
Every instance returned from the various static methods uses the Infinispan marshalling to reduce payload sizes
considerably and should be used whenever possible.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
-
Method Summary
Modifier and TypeMethodDescriptionPredicate taht always returns true irrespective of the value providedProvides a function that returns the key of the entry when invoked.Provides a function that returns the value of the entry when invoked.equalityPredicate
(Object object) Provides a predicate that returns true when the object is equal.static <T> Function<T,
T> identity()
Same asFunction.identity()
except that this instance is also able to be marshalled by Infinispan.static <K,
V> Function<K, CacheEntry<K, V>> Provides a function that given a key will return theCacheEntry
that maps to this key.Predicate that returns true if the object passed to it is not null.
-
Method Details
-
equalityPredicate
Provides a predicate that returns true when the object is equal.- Parameters:
object
- the instance to test equality on- Returns:
- the predicate
-
nonNullPredicate
Predicate that returns true if the object passed to it is not null.- Returns:
- the predicate
-
alwaysTruePredicate
Predicate taht always returns true irrespective of the value provided- Returns:
- the predicate
-
entryToKeyFunction
Provides a function that returns the key of the entry when invoked.- Type Parameters:
K
- key type of the entryV
- value type of the entry- Returns:
- a function that when applied to a given entry will return the key
-
entryToValueFunction
Provides a function that returns the value of the entry when invoked.- Type Parameters:
K
- key type of the entryV
- value type of the entry- Returns:
- a function that when applied to a given entry will return the value
-
identity
Same asFunction.identity()
except that this instance is also able to be marshalled by Infinispan.- Type Parameters:
T
- any type- Returns:
- function that just returns the provided value
-
keyToEntryFunction
Provides a function that given a key will return theCacheEntry
that maps to this key. This function only works when used with aCacheStream
returned from the desiredCache
. The entry will be read from the Cache of which the CacheStream was created from.- Type Parameters:
K
- the key typeV
- the expected value type of the entry- Returns:
- a function that when applied returns the entry for the given key
-