Package org.zeromq.util
Class ZMetadata
java.lang.Object
org.zeromq.util.ZMetadata
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()voidclear()Removes all the properties.booleancontainsKey(String property) Returnstrueif this metada contains the property requestedentrySet()Returns aSetview of the properties contained in this metadata.booleaninthashCode()booleanisEmpty()Returnstrueif this map contains no key-value mappings.keySet()static ZMetadatastatic ZMetadatavoidvoidvoidintsize()Returns the number of properties.toString()values()Returns aCollectionview of the values contained in this metadata.voidwrite(OutputStream stream) Serialize metadata to an output stream, using the specifications of the ZMTP protocol
-
Field Details
-
metadata
-
-
Constructor Details
-
ZMetadata
public ZMetadata() -
ZMetadata
-
-
Method Details
-
keySet
-
get
-
set
-
remove
-
bytes
public byte[] bytes() -
toString
-
hashCode
public int hashCode() -
equals
-
entrySet
Returns aSetview of the properties contained in this metadata. The set is backed by the metadata, so changes to the metadata are reflected in the set, and vice-versa. If the metadata is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation, or through thesetValueoperation on a metadata property returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the metadata, via theIterator.remove,Set.remove,removeAll,retainAllandclearoperations. It does not support theaddoraddAlloperations.- Returns:
- a set view of the properties contained in this metadata
-
values
Returns aCollectionview of the values contained in this metadata. The collection is backed by the metadata, so changes to the map are reflected in the collection, and vice-versa. If the metadata is modified while an iteration over the collection is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding property from the metadata, via theIterator.remove,Collection.remove,removeAll,retainAllandclearoperations. It does not support theaddoraddAlloperations.- Returns:
- a collection view of the values contained in this map
-
set
-
isEmpty
public boolean isEmpty()Returnstrueif this map contains no key-value mappings.- Returns:
trueif this map contains no key-value mappings
-
containsKey
Returnstrueif this metada contains the property requested- Parameters:
property- property the name of the property to be tested.- Returns:
trueif this metada contains the property
-
clear
public void clear()Removes all the properties. The map will be empty after this call returns. -
size
public int size()Returns the number of properties. If it contains more properties thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE.- Returns:
- the number of properties
-
write
Serialize metadata to an output stream, using the specifications of the ZMTP protocolproperty = name value name = OCTET 1*255name-char name-char = ALPHA | DIGIT | "-" | "_" | "." | "+" value = 4OCTET *OCTET ; Size in network byte order
- Parameters:
stream- the output stream- Throws:
IOException- if an I/O error occurs.IllegalStateException- if one of the properties name size is bigger than 255
-
read
-
read
-