Class ZMetadata

java.lang.Object
org.zeromq.util.ZMetadata

public class ZMetadata extends Object
  • Field Details

    • metadata

      private final Metadata metadata
  • Constructor Details

    • ZMetadata

      public ZMetadata()
    • ZMetadata

      public ZMetadata(Metadata metadata)
  • Method Details

    • keySet

      public Set<String> keySet()
    • get

      public String get(String key)
    • set

      public void set(String key, String value)
    • remove

      public void remove(String key)
    • bytes

      public byte[] bytes()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • entrySet

      public Set<Map.Entry<String,String>> entrySet()
      Returns a Set view 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 own remove operation, or through the setValue operation 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 the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.
      Returns:
      a set view of the properties contained in this metadata
    • values

      public Collection<String> values()
      Returns a Collection view 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 own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding property from the metadata, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.
      Returns:
      a collection view of the values contained in this map
    • set

      public void set(Metadata zapProperties)
    • isEmpty

      public boolean isEmpty()
      Returns true if this map contains no key-value mappings.
      Returns:
      true if this map contains no key-value mappings
    • containsKey

      public boolean containsKey(String property)
      Returns true if this metada contains the property requested
      Parameters:
      property - property the name of the property to be tested.
      Returns:
      true if 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 than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
      Returns:
      the number of properties
    • write

      public void write(OutputStream stream) throws IOException
      Serialize metadata to an output stream, using the specifications of the ZMTP protocol
       property = 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

      public static ZMetadata read(String meta)
    • read

      public static ZMetadata read(ZConfig conf)