T - the message typeK - the key typeV - the value typepublic final class MappedChannelReceiver<T,K,V> extends Object implements Terminable
EMPTY| Modifier and Type | Method and Description |
|---|---|
Map<K,V> |
asMap()
Returns a map of the received data.
|
void |
close()
Closes this resource.
|
static <T,K,V> MappedChannelReceiver<T,K,V> |
create(Channel<T> channel,
Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Map<K,V> map)
Creates a new mapped channel receiver.
|
static <T,K> MappedChannelReceiver<T,K,T> |
create(Channel<T> channel,
Function<? super T,? extends K> keyMapper,
Map<K,T> map)
Creates a new mapped channel receiver.
|
static <T,K,V> MappedChannelReceiver<T,K,V> |
createExpiring(Channel<T> channel,
Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
long expiryDuration,
TimeUnit unit)
Creates a new expiring mapped channel receiver.
|
static <T,K> MappedChannelReceiver<T,K,T> |
createExpiring(Channel<T> channel,
Function<? super T,? extends K> keyMapper,
long expiryDuration,
TimeUnit unit)
Creates a new expiring mapped channel receiver.
|
V |
getValue(K key)
Gets a value from the backing data
|
void |
invalidateEntry(K key)
Invalidates a specific entry in the backing data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbindWith, closeAndReportException, closeSilently, isClosed@Nonnull public static <T,K,V> MappedChannelReceiver<T,K,V> createExpiring(@Nonnull Channel<T> channel, @Nonnull Function<? super T,? extends K> keyMapper, @Nonnull Function<? super T,? extends V> valueMapper, long expiryDuration, @Nonnull TimeUnit unit)
T - the message typeK - the key typeV - the value typechannel - the channelkeyMapper - the function used to map keysvalueMapper - the function used to map valuesexpiryDuration - the duration to expire entries afterunit - the unit of the duration@Nonnull public static <T,K> MappedChannelReceiver<T,K,T> createExpiring(@Nonnull Channel<T> channel, @Nonnull Function<? super T,? extends K> keyMapper, long expiryDuration, @Nonnull TimeUnit unit)
T - the message typeK - the key typechannel - the channelkeyMapper - the function used to map keysexpiryDuration - the duration to expire entries afterunit - the unit of the duration@Nonnull public static <T,K,V> MappedChannelReceiver<T,K,V> create(@Nonnull Channel<T> channel, @Nonnull Function<? super T,? extends K> keyMapper, @Nonnull Function<? super T,? extends V> valueMapper, Map<K,V> map)
T - the message typeK - the key typeV - the value typechannel - the channelkeyMapper - the function used to map keysvalueMapper - the function used to map valuesmap - the map instance used to back the instance@Nonnull public static <T,K> MappedChannelReceiver<T,K,T> create(@Nonnull Channel<T> channel, @Nonnull Function<? super T,? extends K> keyMapper, Map<K,T> map)
T - the message typeK - the key typechannel - the channelkeyMapper - the function used to map keysmap - the map instance used to back the instance@Nullable public V getValue(@Nonnull K key)
key - the keypublic void invalidateEntry(@Nonnull K key)
key - the keypublic void close()
Terminableclose in interface AutoCloseableclose in interface TerminableCopyright © 2022. All rights reserved.