public class MapEvent extends com.streamscape.sdo.event.AbstractMutableEvent implements EventDatagram
Title: Structured Data Objects: Map Event
Description: An event object containing name-value pairs.
MapEvent
is used to send a set of name-value pairs. The names
are String
objects, and the values are Java objects or primitive
data types. The names must have a value that is not null, and not an empty
string. The entries can be accessed sequentially or randomly by name. The
order of the entries is undefined.
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
SEMANTIC_TYPE_NAME
DEFAULT_SERIAL_VERSION_ID
Modifier and Type | Method and Description |
---|---|
void |
addLocator(java.lang.String locator)
Adds the specified locator to the map.
|
void |
addLocatorsAll(java.lang.String str)
Parses the specified string and adds all locators found to the map.
|
void |
addLocatorsAllFrom(java.lang.String propertyName)
Parses the
String property with the specified name and adds all locators found to the map. |
void |
addTag(java.lang.String tag)
Adds the specified hashtag to the map.
|
void |
addTagsAll(java.lang.String str)
Parses the specified string and adds all hashtags found to the map.
|
void |
addTagsAllFrom(java.lang.String propertyName)
Parses the
String property with the specified name and adds all hashtags found to the map. |
void |
addTagsAndLocatorsAll(java.lang.String str)
Parses the specified string and adds all hashtags and locators found to the map.
|
void |
addTagsAndLocatorsAllFrom(java.lang.String propertyName)
Parses the
String property with the specified name and adds all locators found to the map. |
void |
clearData()
Clears the data of this event.
|
boolean |
equals(java.lang.Object other) |
java.lang.Object |
get(java.lang.String name)
Alias for
getObject(String) . |
java.math.BigDecimal |
getBigDecimal(java.lang.String name)
Returns a
BigDecimal value with the specified name. |
boolean |
getBoolean(java.lang.String name)
Returns a
boolean value with the specified name. |
byte |
getByte(java.lang.String name)
Returns a
byte value with the specified name. |
byte[] |
getBytes(java.lang.String name)
Returns a copy of the byte_array value with the specified name.
|
char |
getChar(java.lang.String name)
Returns a
char value with the specified name. |
java.util.Date |
getDate(java.lang.String name)
Returns a
Date value with the specified name. |
double |
getDouble(java.lang.String name)
Returns a
double value with the specified name. |
float |
getFloat(java.lang.String name)
Returns a
float value with the specified name. |
int |
getInt(java.lang.String name)
Returns a
int value with the specified name. |
long |
getLong(java.lang.String name)
Returns a
long value with the specified name. |
java.util.HashMap |
getMap() |
java.util.Set |
getMapNames()
Returns a set of names of all objects.
|
java.lang.Object |
getObject(java.lang.String name)
Returns a value of the object with the specified name.
|
short |
getShort(java.lang.String name)
Returns a
short value with the specified name. |
java.lang.String |
getString(java.lang.String name)
Returns a
String value with the specified name. |
boolean |
itemExists(java.lang.String name)
Checks if a value with the specified name exists.
|
void |
set(java.lang.String name,
java.lang.Object value)
Alias for
setObject(String, Object) . |
void |
setBigDecimal(java.lang.String name,
java.math.BigDecimal value)
Sets the
BigDecimal value with the specified name. |
void |
setBoolean(java.lang.String name,
boolean value)
Sets the
boolean value with the specified name. |
void |
setByte(java.lang.String name,
byte value)
Sets the
byte value with the specified name. |
void |
setBytes(java.lang.String name,
byte[] value)
Sets a
copy of the specified byte array value with the specified name. |
void |
setBytes(java.lang.String name,
byte[] value,
int offset,
int length)
Sets a portion of the byte array value with the specified name.
|
void |
setChar(java.lang.String name,
char value)
Sets the
char value with the specified name. |
void |
setDate(java.lang.String name,
java.util.Date value)
Sets the
Date value with the specified name. |
void |
setDouble(java.lang.String name,
double value)
Sets the
double value with the specified name. |
void |
setFloat(java.lang.String name,
float value)
Sets the
float value with the specified name. |
void |
setInt(java.lang.String name,
int value)
Sets the
int value with the specified name. |
void |
setLong(java.lang.String name,
long value)
Sets the
long value with the specified name. |
void |
setMap(java.util.Map map) |
void |
setObject(java.lang.String name,
java.lang.Object value)
Sets the specified value with the specified name.
|
void |
setShort(java.lang.String name,
short value)
Sets the
short value with the specified name. |
void |
setString(java.lang.String name,
java.lang.String value)
Sets the
String value with the specified name. |
addAnnotation, clearEventProperties, protect, removeAnnotation, removeEventProperty, resetReplyTo, setCorrelationId, setCorrelationIdAsBytes, setDurable, setEventBigDecimalProperty, setEventBigDecimalProperty, setEventBooleanProperty, setEventByteProperty, setEventDoubleProperty, setEventExpiration, setEventFloatProperty, setEventGroupId, setEventIntProperty, setEventKey, setEventLongProperty, setEventObjectProperty, setEventShortProperty, setEventStringProperty, setFinal, setForwardTo, setReplyTo, setSecurityAssertionToken, setSecurityAssertionTokenAsBytes, unprotect
canConvertEventProperty, clone, existsEventProperty, getAnnotatedProperties, getAnnotation, getCorrelationId, getCorrelationIdAsBytes, getDurable, getEventBigDecimalProperty, getEventBooleanProperty, getEventByteProperty, getEventDoubleProperty, getEventExpiration, getEventFloatProperty, getEventGroupId, getEventId, getEventIntProperty, getEventKey, getEventLongProperty, getEventObjectProperty, getEventPropertyNames, getEventPropertyType, getEventShortProperty, getEventSource, getEventStringProperty, getForwardTo, getPermissions, getReadAccess, getReplyTo, getSecurityAssertionToken, getSecurityAssertionTokenAsBytes, getTimestamp, getTransmitAccess, getWriteAccess, hasAnnotatedProperties, hasSuitableAnnotationType, isProtected
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAnnotation, canConvertEventProperty, clearEventProperties, existsEventProperty, getAnnotatedProperties, getAnnotation, getCorrelationId, getCorrelationIdAsBytes, getEventBigDecimalProperty, getEventBooleanProperty, getEventByteProperty, getEventDoubleProperty, getEventExpiration, getEventFloatProperty, getEventIntProperty, getEventLongProperty, getEventObjectProperty, getEventPropertyNames, getEventPropertyType, getEventShortProperty, getEventStringProperty, getForwardTo, getPermissions, getReadAccess, getReplyTo, getSecurityAssertionToken, getSecurityAssertionTokenAsBytes, getTransmitAccess, getWriteAccess, hasAnnotatedProperties, isProtected, protect, removeAnnotation, removeEventProperty, resetReplyTo, setCorrelationId, setCorrelationIdAsBytes, setDurable, setEventBigDecimalProperty, setEventBigDecimalProperty, setEventBooleanProperty, setEventByteProperty, setEventDoubleProperty, setEventExpiration, setEventFloatProperty, setEventGroupId, setEventIntProperty, setEventKey, setEventLongProperty, setEventObjectProperty, setEventShortProperty, setEventStringProperty, setFinal, setForwardTo, setReplyTo, setSecurityAssertionToken, setSecurityAssertionTokenAsBytes, unprotect
clone, getDurable, getEventGroupId, getEventId, getEventKey, getEventSource, getTimestamp
getSerialVersionUID
public void setMap(java.util.Map map) throws SecurityViolationException
SecurityViolationException
public java.util.HashMap getMap() throws SecurityViolationException
SecurityViolationException
public boolean getBoolean(java.lang.String name) throws SecurityViolationException, SDOException
boolean
value with the specified name.name
- the specified name.boolean
value with the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public byte getByte(java.lang.String name) throws SecurityViolationException, SDOException
byte
value with the specified name.name
- the specified name.byte
value with the specified nameSecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public short getShort(java.lang.String name) throws SecurityViolationException, SDOException
short
value with the specified name.name
- the specified name.short
value with the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public char getChar(java.lang.String name) throws SecurityViolationException, SDOException
char
value with the specified name.name
- the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public int getInt(java.lang.String name) throws SecurityViolationException, SDOException
int
value with the specified name.name
- the specified name.int
value with the specified nameSecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public long getLong(java.lang.String name) throws SecurityViolationException, SDOException
long
value with the specified name.name
- the specified name.long
value with the specified nameSecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public float getFloat(java.lang.String name) throws SecurityViolationException, SDOException
float
value with the specified name.name
- the specified name.float
value with the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public double getDouble(java.lang.String name) throws SecurityViolationException, SDOException
double
value with the specified name.name
- the specified name.double
value with the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public java.math.BigDecimal getBigDecimal(java.lang.String name) throws SecurityViolationException, SDOException
BigDecimal
value with the specified name.name
- the specified name.BigDecimal
value with the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public java.lang.String getString(java.lang.String name) throws SecurityViolationException, SDOException
String
value with the specified name.name
- the specified name.String
value with the specified name or null
if the specified value does not exist.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public byte[] getBytes(java.lang.String name) throws SecurityViolationException, SDOException
name
- the specified name.null
if the specified value does not exist.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public java.util.Date getDate(java.lang.String name) throws SecurityViolationException, SDOException
Date
value with the specified name.name
- the specified name.Date
value with the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
- if a value with the specified name has other type.public java.lang.Object getObject(java.lang.String name) throws SecurityViolationException, SDOException
The returned value can be one of the following types:
If the found value is a byte_array, a copy of this value will be returned.
name
- the specified name.SecurityViolationException
- if the event is protected from read access.SDOException
public java.lang.Object get(java.lang.String name) throws SecurityViolationException, SDOException
getObject(String)
.public java.util.Set getMapNames() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public void setBoolean(java.lang.String name, boolean value) throws SecurityViolationException
boolean
value with the specified name.name
- the specified name.value
- the boolean
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setByte(java.lang.String name, byte value) throws SecurityViolationException
byte
value with the specified name.name
- the specified name.value
- the byte
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setShort(java.lang.String name, short value) throws SecurityViolationException
short
value with the specified name.name
- the specified name.value
- the short
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setChar(java.lang.String name, char value) throws SecurityViolationException
char
value with the specified name.name
- the specified name.value
- the Unicode character value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setInt(java.lang.String name, int value) throws SecurityViolationException
int
value with the specified name.name
- the specified name.value
- the int
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setLong(java.lang.String name, long value) throws SecurityViolationException
long
value with the specified name.name
- the specified name.value
- the long
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setFloat(java.lang.String name, float value) throws SecurityViolationException
float
value with the specified name.name
- the specified name.value
- the float
value to set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setDouble(java.lang.String name, double value) throws SecurityViolationException
double
value with the specified name.name
- the specified name.value
- the double
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setBigDecimal(java.lang.String name, java.math.BigDecimal value) throws SecurityViolationException
BigDecimal
value with the specified name.name
- the specified name.value
- the BigDecimal
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setString(java.lang.String name, java.lang.String value) throws SecurityViolationException
String
value with the specified name.name
- the specified name.value
- the String
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setDate(java.lang.String name, java.util.Date value) throws SecurityViolationException
Date
value with the specified name.name
- the specified name.value
- the Date
value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setBytes(java.lang.String name, byte[] value) throws SecurityViolationException
copy
of the specified byte array value with the specified name.name
- the specified name.value
- the byte array value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setBytes(java.lang.String name, byte[] value, int offset, int length) throws SecurityViolationException
name
- the specified name.value
- the byte array value to be set.offset
- the initial offset within the byte array.length
- the number of bytes to use.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void setObject(java.lang.String name, java.lang.Object value) throws SecurityViolationException, SDOException
The value can be one of the following types:
If the value is a byte_array, a copy of this value will be set.
name
- the name of the entry.value
- the entry value to set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.SDOException
- if the value type is wrong.public void set(java.lang.String name, java.lang.Object value) throws SecurityViolationException, SDOException
setObject(String, Object)
.public boolean itemExists(java.lang.String name) throws SecurityViolationException
name
- the specified name.true
if a value with the specified name exists, false
otherwise.SecurityViolationException
- if the event is protected from read access.public void clearData() throws SecurityViolationException
SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void addTag(java.lang.String tag) throws SecurityViolationException, SDOException
tag
parameter and the String
value "tag"
.
setString(tag.substring(1), "tag")
.
The tag
parameter must be started with # character.
tag
- the name of the pair to be added.SecurityViolationException
- if the event is protected from write access.SDOException
- if the specified parameter has invalid format.public void addTagsAll(java.lang.String str) throws SecurityViolationException
addTag(String)
for further details.str
- the string to be parsed.SecurityViolationException
- if the event is protected from write access.public void addTagsAllFrom(java.lang.String propertyName) throws SecurityViolationException, SDOException
String
property with the specified name and adds all hashtags found to the map.
addTag(String)
for further details.propertyName
- the name of the property to be parsed.SecurityViolationException
- if the event is protected from write access.SDOException
- if the property does not exist or has a wrong type.public void addLocator(java.lang.String locator) throws SecurityViolationException, SDOException
locator
parameter and the String
value "locator"
.
setString(locator.substring(1), "locator")
.
The tag
parameter must be started with @ character.
locator
- the name of the pair to be added.SecurityViolationException
- if the event is protected from write access.SDOException
- if the specified parameter has invalid format.public void addLocatorsAll(java.lang.String str) throws SecurityViolationException
addLocator(String)
for further details.str
- the string to be parsed.SecurityViolationException
- if the event is protected from write access.public void addLocatorsAllFrom(java.lang.String propertyName) throws SecurityViolationException, SDOException
String
property with the specified name and adds all locators found to the map.
addTag(String)
for further details.propertyName
- the name of the property to be parsed.SecurityViolationException
- if the event is protected from write access.SDOException
- if the property does not exist or has a wrong type.public void addTagsAndLocatorsAll(java.lang.String str) throws SecurityViolationException
addTag(String)
and addLocator(String)
for further details.str
- the string to be parsed.SecurityViolationException
- if the event is protected from write access.public void addTagsAndLocatorsAllFrom(java.lang.String propertyName) throws SecurityViolationException, SDOException
String
property with the specified name and adds all locators found to the map.
addTag(String)
and addLocator(String)
for further details.propertyName
- the name of the property to be parsed.SecurityViolationException
- if the event is protected from write access.SDOException
- if the property does not exist or has a wrong type.public boolean equals(java.lang.Object other)
equals
in class com.streamscape.sdo.IAbstractDataEvent
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.