Package com.attivio.sdk.esb
Class MessageList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- com.attivio.sdk.esb.AbstractListMessage<PlatformMessage>
-
- com.attivio.sdk.esb.MessageList
-
- All Implemented Interfaces:
PlatformMessage
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<PlatformMessage>
,java.util.Collection<PlatformMessage>
,java.util.List<PlatformMessage>
,java.util.RandomAccess
public class MessageList extends AbstractListMessage<PlatformMessage> implements PlatformMessage
Represents a list of otherPlatformMessage
s.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.attivio.sdk.esb.PlatformMessage
DEFAULT_MAX_LOG_LENGTH, MESSAGE_DROPPED, MESSAGE_SEND_TIME_PROP, PROP_MAX_LOG_LENGTH
-
-
Constructor Summary
Constructors Constructor Description MessageList(java.util.UUID clientId)
Constructor with the given client ID.MessageList(java.util.UUID clientId, int size)
Constructor with a client ID and a size.MessageList(java.util.UUID clientId, PlatformMessage... msgs)
Constructor with a client ID and a list of messages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(PlatformMessage message)
protected PlatformMessage
clone(PlatformMessage tmp)
boolean
containsMessage(java.lang.Class<? extends PlatformMessage> clazz)
Checks to see if this list contains a message of the specified class type.boolean
equals(java.lang.Object other)
long
getEstimatedSize()
<T extends PlatformMessage>
TgetMessage(java.lang.Class<T> clazz)
Gets the first instance of a message of the specified type, walking into inner MessageLists if presentint
hashCode()
<T extends PlatformMessage>
java.util.Iterator<T>iterator(java.lang.Class<T> messageClass)
Return an iterator that will recursively iterate over all sub messages of this MessageList.-
Methods inherited from class com.attivio.sdk.esb.AbstractListMessage
addMessageHistory, addMessageHistory, clone, getClientId, getMessageHistory, getMessageId, getMetadata, getProperty, getWorkflowQueue, getWorkflowQueue, isRedelivered, removeProperty, setClientId, setMessageId, setProperty, setRedelivered, setWorkflowQueue, setWorkflowQueue, toMessageString, toString, toStringDetailed
-
Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.attivio.sdk.esb.PlatformMessage
addMessageHistory, addMessageHistory, clone, getClientId, getMessageHistory, getMessageId, getMetadata, getProperty, getWorkflowQueue, getWorkflowQueue, isRedelivered, removeProperty, setClientId, setMessageId, setProperty, setRedelivered, setWorkflowQueue, setWorkflowQueue, toMessageString
-
-
-
-
Constructor Detail
-
MessageList
public MessageList(java.util.UUID clientId)
Constructor with the given client ID.- Parameters:
clientId
- the client ID
-
MessageList
public MessageList(java.util.UUID clientId, int size)
Constructor with a client ID and a size.- Parameters:
clientId
- the client IDsize
- the size
-
MessageList
public MessageList(java.util.UUID clientId, PlatformMessage... msgs)
Constructor with a client ID and a list of messages. If any of the messages passed to this constructor are themselvesMessageList
s, then you may want to add them with theArrayList.addAll(java.util.Collection)
method if you want them added as individual messages instead of a nestedMessageList
within thisMessageList
.- Parameters:
clientId
- the client IDmsgs
- the messages
-
-
Method Detail
-
containsMessage
public boolean containsMessage(java.lang.Class<? extends PlatformMessage> clazz)
Checks to see if this list contains a message of the specified class type.- Parameters:
clazz
- the class to check for using instanceof- Returns:
- true if the list contains one of these elements
-
getMessage
public <T extends PlatformMessage> T getMessage(java.lang.Class<T> clazz)
Gets the first instance of a message of the specified type, walking into inner MessageLists if present- Parameters:
clazz
- the class to find- Returns:
- the message instance or null if not found
-
iterator
public <T extends PlatformMessage> java.util.Iterator<T> iterator(java.lang.Class<T> messageClass)
Return an iterator that will recursively iterate over all sub messages of this MessageList.- Parameters:
messageClass
- the PlatformMessage class to select for iteration.- Returns:
- an iterator that will yield messageClass instances.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<PlatformMessage>
- Specified by:
hashCode
in interfacejava.util.List<PlatformMessage>
- Overrides:
hashCode
in classAbstractListMessage<PlatformMessage>
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.util.Collection<PlatformMessage>
- Specified by:
equals
in interfacejava.util.List<PlatformMessage>
- Overrides:
equals
in classAbstractListMessage<PlatformMessage>
-
clone
protected PlatformMessage clone(PlatformMessage tmp)
- Specified by:
clone
in classAbstractListMessage<PlatformMessage>
-
add
public boolean add(PlatformMessage message)
- Specified by:
add
in interfacejava.util.Collection<PlatformMessage>
- Specified by:
add
in interfacejava.util.List<PlatformMessage>
- Overrides:
add
in classjava.util.ArrayList<PlatformMessage>
-
getEstimatedSize
public long getEstimatedSize()
- Specified by:
getEstimatedSize
in interfacePlatformMessage
- Overrides:
getEstimatedSize
in classAbstractListMessage<PlatformMessage>
-
-