Class PendingMessages
java.lang.Object
org.springframework.data.redis.connection.stream.PendingMessages
- All Implemented Interfaces:
Iterable<PendingMessage>
,Supplier<Stream<PendingMessage>>
,org.springframework.data.util.Streamable<PendingMessage>
public class PendingMessages
extends Object
implements org.springframework.data.util.Streamable<PendingMessage>
Value object holding detailed information about pending messages in consumer group for a given
Range
and offset.- Since:
- 2.3
- Author:
- Christoph Strobl
-
Constructor Summary
ConstructorDescriptionPendingMessages
(String groupName, List<PendingMessage> pendingMessages) PendingMessages
(String groupName, org.springframework.data.domain.Range<?> range, List<PendingMessage> pendingMessages) -
Method Summary
Modifier and TypeMethodDescriptionget
(int index) Get thePendingMessage
at the given position.The consumer group name.org.springframework.data.domain.Range<?>
getRange()
TheRange
pending messages have been loaded.boolean
isEmpty()
iterator()
int
size()
toString()
withinRange
(org.springframework.data.domain.Range<?> range) Adds the range to the currentPendingMessages
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.springframework.data.util.Streamable
and, and, and, and, filter, flatMap, get, map, stream, toList, toSet
-
Constructor Details
-
PendingMessages
-
PendingMessages
public PendingMessages(String groupName, org.springframework.data.domain.Range<?> range, List<PendingMessage> pendingMessages)
-
-
Method Details
-
withinRange
Adds the range to the currentPendingMessages
.- Parameters:
range
- must not be null.- Returns:
- new instance of
PendingMessages
.
-
getGroupName
The consumer group name.- Returns:
- never null.
-
getRange
public org.springframework.data.domain.Range<?> getRange()TheRange
pending messages have been loaded.- Returns:
- never null.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceorg.springframework.data.util.Streamable<PendingMessage>
- Returns:
- true if no messages pending within range.
-
size
public int size()- Returns:
- the number of pending messages in range.
-
get
Get thePendingMessage
at the given position.- Parameters:
index
-- Returns:
- the
PendingMessage
a the given index. - Throws:
IndexOutOfBoundsException
- if the index is out of range.
-
iterator
- Specified by:
iterator
in interfaceIterable<PendingMessage>
-
toString
-