Class TypedProperties
- java.lang.Object
-
- org.apache.activemq.artemis.utils.collections.TypedProperties
-
- Direct Known Subclasses:
TypedProperties
public class TypedProperties extends java.lang.ObjectProperty Value Conversion.This implementation follows section 3.5.4 of the Java Message Service specification (Version 1.1 April 12, 2002).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypedProperties.StringValuestatic classTypedProperties.TypedPropertiesDecoderPoolsstatic classTypedProperties.TypedPropertiesStringSimpleStringPools
-
Constructor Summary
Constructors Constructor Description TypedProperties()TypedProperties(java.util.function.Predicate<SimpleString> internalPropertyPredicate)TypedProperties(TypedProperties other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleanclearInternalProperties()booleancontainsProperty(SimpleString key)voiddecode(io.netty.buffer.ByteBuf buffer)voiddecode(io.netty.buffer.ByteBuf buffer, TypedProperties.TypedPropertiesDecoderPools keyValuePools)intencode(io.netty.buffer.ByteBuf buffer)voidforEach(java.util.function.BiConsumer<SimpleString,java.lang.Object> action)voidforEachKey(java.util.function.Consumer<SimpleString> action)java.lang.BooleangetBooleanProperty(SimpleString key)java.lang.BytegetByteProperty(SimpleString key)java.lang.BytegetByteProperty(SimpleString key, java.util.function.Supplier<java.lang.Byte> defaultValue)byte[]getBytesProperty(SimpleString key)java.lang.CharactergetCharProperty(SimpleString key)java.lang.DoublegetDoubleProperty(SimpleString key)intgetEncodeSize()java.lang.FloatgetFloatProperty(SimpleString key)java.lang.IntegergetIntProperty(SimpleString key)java.lang.LonggetLongProperty(SimpleString key)java.util.Map<java.lang.String,java.lang.Object>getMap()java.util.Set<java.lang.String>getMapNames()intgetMemoryOffset()java.lang.ObjectgetProperty(SimpleString key)java.util.Set<SimpleString>getPropertyNames()java.lang.ShortgetShortProperty(SimpleString key)SimpleStringgetSimpleStringProperty(SimpleString key)booleanisEmpty()voidputBooleanProperty(SimpleString key, boolean value)voidputByteProperty(SimpleString key, byte value)voidputBytesProperty(SimpleString key, byte[] value)voidputCharProperty(SimpleString key, char value)voidputDoubleProperty(SimpleString key, double value)voidputFloatProperty(SimpleString key, float value)voidputIntProperty(SimpleString key, int value)voidputLongProperty(SimpleString key, long value)voidputNullValue(SimpleString key)TypedPropertiesputProperty(SimpleString key, java.lang.Object value)voidputShortProperty(SimpleString key, short value)voidputSimpleStringProperty(SimpleString key, SimpleString value)voidputTypedProperties(TypedProperties otherProps)java.lang.ObjectremoveProperty(SimpleString key)static booleansearchProperty(SimpleString key, io.netty.buffer.ByteBuf buffer, int startIndex)Performs a search among the valid key properties contained inbuffer, starting fromfromassuming it to be a valid encodedTypedPropertiescontent.static voidsetObjectProperty(SimpleString key, java.lang.Object value, TypedProperties properties)Helper for MapMessage#setObjectProperty(String, Object)intsize()Return the number of propertiesjava.lang.StringtoString()
-
-
-
Constructor Detail
-
TypedProperties
public TypedProperties()
-
TypedProperties
public TypedProperties(java.util.function.Predicate<SimpleString> internalPropertyPredicate)
-
TypedProperties
public TypedProperties(TypedProperties other)
-
-
Method Detail
-
size
public int size()
Return the number of properties
-
getMemoryOffset
public int getMemoryOffset()
-
putBooleanProperty
public void putBooleanProperty(SimpleString key, boolean value)
-
putByteProperty
public void putByteProperty(SimpleString key, byte value)
-
putBytesProperty
public void putBytesProperty(SimpleString key, byte[] value)
-
putShortProperty
public void putShortProperty(SimpleString key, short value)
-
putIntProperty
public void putIntProperty(SimpleString key, int value)
-
putLongProperty
public void putLongProperty(SimpleString key, long value)
-
putFloatProperty
public void putFloatProperty(SimpleString key, float value)
-
putDoubleProperty
public void putDoubleProperty(SimpleString key, double value)
-
putSimpleStringProperty
public void putSimpleStringProperty(SimpleString key, SimpleString value)
-
putNullValue
public void putNullValue(SimpleString key)
-
putCharProperty
public void putCharProperty(SimpleString key, char value)
-
putTypedProperties
public void putTypedProperties(TypedProperties otherProps)
-
putProperty
public TypedProperties putProperty(SimpleString key, java.lang.Object value)
-
getProperty
public java.lang.Object getProperty(SimpleString key)
-
getBooleanProperty
public java.lang.Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getByteProperty
public java.lang.Byte getByteProperty(SimpleString key, java.util.function.Supplier<java.lang.Byte> defaultValue) throws ActiveMQPropertyConversionException
-
getByteProperty
public java.lang.Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getCharProperty
public java.lang.Character getCharProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getBytesProperty
public byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getDoubleProperty
public java.lang.Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getIntProperty
public java.lang.Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getLongProperty
public java.lang.Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getShortProperty
public java.lang.Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getFloatProperty
public java.lang.Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getSimpleStringProperty
public SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
removeProperty
public java.lang.Object removeProperty(SimpleString key)
-
containsProperty
public boolean containsProperty(SimpleString key)
-
getPropertyNames
public java.util.Set<SimpleString> getPropertyNames()
-
clearInternalProperties
public boolean clearInternalProperties()
-
forEachKey
public void forEachKey(java.util.function.Consumer<SimpleString> action)
-
forEach
public void forEach(java.util.function.BiConsumer<SimpleString,java.lang.Object> action)
-
searchProperty
public static boolean searchProperty(SimpleString key, io.netty.buffer.ByteBuf buffer, int startIndex)
Performs a search among the valid key properties contained inbuffer, starting fromfromassuming it to be a valid encodedTypedPropertiescontent.- Throws:
java.lang.IllegalStateException- if any not-valid property is found while searching thekeyproperty
-
decode
public void decode(io.netty.buffer.ByteBuf buffer, TypedProperties.TypedPropertiesDecoderPools keyValuePools)
-
decode
public void decode(io.netty.buffer.ByteBuf buffer)
-
encode
public int encode(io.netty.buffer.ByteBuf buffer)
-
getEncodeSize
public int getEncodeSize()
-
clear
public void clear()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isEmpty
public boolean isEmpty()
-
getMapNames
public java.util.Set<java.lang.String> getMapNames()
-
getMap
public java.util.Map<java.lang.String,java.lang.Object> getMap()
-
setObjectProperty
public static void setObjectProperty(SimpleString key, java.lang.Object value, TypedProperties properties)
Helper for MapMessage#setObjectProperty(String, Object)- Parameters:
key- The SimpleString keyvalue- The Object valueproperties- The typed properties
-
-