Package oracle.nosql.driver

# 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 Summary

  Constructors
  Constructor
  Description
  `FreeFormTags()`
  Creates a new instance of FreeFormTags.
  `FreeFormTags(String jsonString)`
  Creates a new instance of FreeFormTags from JSON string input.
  `FreeFormTags(Map<String,String> map)`
  Creates a new instance of FreeFormTags from a Map

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FreeFormTags`
  `addTag(String key, String value)`
  Adds a new tag to the set of tags
  `boolean`
  `contains(String key)`
  Returns true if the specified key exists in the tags map
  `String`
  `getTag(String key)`
  Returns the value of the named tag or null if it does not exist
  `Iterator<Map.Entry<String,FieldValue>>`
  `iterator()`
  `int`
  `size()`
  Returns the number of tags in the set
  `String`
  `toString()`
  Returns the free-form tags as a JSON string

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## 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>>`