Class BaseTaggableObject

java.lang.Object
org.bitcoinj.utils.BaseTaggableObject
All Implemented Interfaces:
TaggableObject
Direct Known Subclasses:
Wallet

public class BaseTaggableObject extends Object implements TaggableObject
A simple implementation of TaggableObject that uses a hashmap that is synchronized on this object's Java monitor.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<String,com.google.protobuf.ByteString>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.protobuf.ByteString
    Returns the immutable byte array associated with the given tag name, or throws IllegalArgumentException if that tag wasn't set yet.
    Map<String,com.google.protobuf.ByteString>
    Returns a copy of all the tags held by this object.
    com.google.protobuf.ByteString
    Returns the immutable byte array associated with the given tag name, or null if there is none.
    void
    setTag(String tag, com.google.protobuf.ByteString value)
    Associates the given immutable byte array with the string tag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tags

      protected final Map<String,com.google.protobuf.ByteString> tags
  • Constructor Details

    • BaseTaggableObject

      public BaseTaggableObject()
  • Method Details

    • maybeGetTag

      @Nullable public com.google.protobuf.ByteString maybeGetTag(String tag)
      Description copied from interface: TaggableObject
      Returns the immutable byte array associated with the given tag name, or null if there is none.
      Specified by:
      maybeGetTag in interface TaggableObject
    • getTag

      public com.google.protobuf.ByteString getTag(String tag)
      Description copied from interface: TaggableObject
      Returns the immutable byte array associated with the given tag name, or throws IllegalArgumentException if that tag wasn't set yet.
      Specified by:
      getTag in interface TaggableObject
    • setTag

      public void setTag(String tag, com.google.protobuf.ByteString value)
      Description copied from interface: TaggableObject
      Associates the given immutable byte array with the string tag. See the docs for TaggableObject to learn more.
      Specified by:
      setTag in interface TaggableObject
    • getTags

      public Map<String,com.google.protobuf.ByteString> getTags()
      Description copied from interface: TaggableObject
      Returns a copy of all the tags held by this object.
      Specified by:
      getTags in interface TaggableObject