Class FreeFormTags

java.lang.Object
oracle.nosql.driver.FreeFormTags
All Implemented Interfaces:
Iterable<Map.Entry<String,FieldValue>>

public class FreeFormTags extends Object implements Iterable<Map.Entry<String,FieldValue>>
Cloud service only. FreeFormTags is a class to encapsulate free-form tags which are returned from calls to NoSQLHandle.getTable(oracle.nosql.driver.ops.GetTableRequest). They can also be set during table creation operations as well as alter table operations.
Since:
5.4
  • Constructor Details

    • FreeFormTags

      public FreeFormTags()
      Creates a new instance of FreeFormTags. This method along with addTag(java.lang.String, java.lang.String) is used to add tags to a call to create or modify a table.
    • FreeFormTags

      public FreeFormTags(String jsonString)
      Creates a new instance of FreeFormTags from JSON string input.
      Parameters:
      jsonString - a JSON string
    • FreeFormTags

      public FreeFormTags(Map<String,String> map)
      Creates a new instance of FreeFormTags from a Map
      Parameters:
      map - the map
  • Method Details

    • addTag

      public FreeFormTags addTag(String key, String value)
      Adds a new tag to the set of tags
      Parameters:
      key - the tag key
      value - the tag value
      Returns:
      this
    • getTag

      public String getTag(String key)
      Returns the value of the named tag or null if it does not exist
      Parameters:
      key - the key
      Returns:
      the tag value or null
    • size

      public int size()
      Returns the number of tags in the set
      Returns:
      the size
    • contains

      public boolean contains(String key)
      Returns true if the specified key exists in the tags map
      Parameters:
      key - the key
      Returns:
      true if the key exists
    • toString

      public String toString()
      Returns the free-form tags as a JSON string
      Overrides:
      toString in class Object
      Returns:
      the JSON string
    • iterator

      public Iterator<Map.Entry<String,FieldValue>> iterator()
      Specified by:
      iterator in interface Iterable<Map.Entry<String,FieldValue>>