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 otherPlatformMessages.- 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 booleanadd(PlatformMessage message)protected PlatformMessageclone(PlatformMessage tmp)booleancontainsMessage(java.lang.Class<? extends PlatformMessage> clazz)Checks to see if this list contains a message of the specified class type.booleanequals(java.lang.Object other)longgetEstimatedSize()<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 presentinthashCode()<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 themselvesMessageLists, 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 nestedMessageListwithin 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:
hashCodein interfacejava.util.Collection<PlatformMessage>- Specified by:
hashCodein interfacejava.util.List<PlatformMessage>- Overrides:
hashCodein classAbstractListMessage<PlatformMessage>
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equalsin interfacejava.util.Collection<PlatformMessage>- Specified by:
equalsin interfacejava.util.List<PlatformMessage>- Overrides:
equalsin classAbstractListMessage<PlatformMessage>
-
clone
protected PlatformMessage clone(PlatformMessage tmp)
- Specified by:
clonein classAbstractListMessage<PlatformMessage>
-
add
public boolean add(PlatformMessage message)
- Specified by:
addin interfacejava.util.Collection<PlatformMessage>- Specified by:
addin interfacejava.util.List<PlatformMessage>- Overrides:
addin classjava.util.ArrayList<PlatformMessage>
-
getEstimatedSize
public long getEstimatedSize()
- Specified by:
getEstimatedSizein interfacePlatformMessage- Overrides:
getEstimatedSizein classAbstractListMessage<PlatformMessage>
-
-