Package com.sap.ai.sdk.grounding.model

# Class DocumentMetadata

java.lang.Object
com.sap.ai.sdk.grounding.model.DocumentMetadata

public class DocumentMetadata extends Object
DocumentMetadata

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `DocumentMetadata.Builder`
  Builder helper class.
  `static interface`
  `DocumentMetadata.Builder1`
  Builder helper class.
  `static enum`
  `DocumentMetadata.MatchModeEnum`
  Match mode for the metadata key (ANY or ALL).

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `DocumentMetadata()`
  Default constructor for DocumentMetadata.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DocumentMetadata`
  `addValueItem(String valueItem)`
  Add one value instance to this `DocumentMetadata`.
  `static DocumentMetadata.Builder`
  `create()`
  Create a type-safe, fluent-api builder object to construct a new `DocumentMetadata` instance with all required arguments.
  `boolean`
  `equals(Object o)`
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `DocumentMetadata`.
  `String`
  `getKey()`
  Metadata key name.
  `DocumentMetadata.MatchModeEnum`
  `getMatchMode()`
  Match mode for the metadata key (ANY or ALL).
  `List<String>`
  `getValue()`
  An array of string values associated with the metadata key.
  `int`
  `hashCode()`
  `DocumentMetadata`
  `key(String key)`
  Set the key of this `DocumentMetadata` instance and return the same instance.
  `DocumentMetadata`
  `matchMode(DocumentMetadata.MatchModeEnum matchMode)`
  Set the matchMode of this `DocumentMetadata` instance and return the same instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `DocumentMetadata` instance.
  `void`
  `setKey(String key)`
  Set the key of this `DocumentMetadata` instance.
  `void`
  `setMatchMode(DocumentMetadata.MatchModeEnum matchMode)`
  Set the matchMode of this `DocumentMetadata` instance.
  `void`
  `setValue(List<String> value)`
  Set the value of this `DocumentMetadata` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `DocumentMetadata` instance including unrecognized properties.
  `String`
  `toString()`
  `DocumentMetadata`
  `value(List<String> value)`
  Set the value of this `DocumentMetadata` instance and return the same instance.

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DocumentMetadata

    protected DocumentMetadata()
    Default constructor for DocumentMetadata.

- ## Method Details

  - ### key

    @Nonnull public DocumentMetadata key(@Nonnull String key)
    Set the key of this `DocumentMetadata` instance and return the same instance.
    Parameters:
      `key` - Metadata key name.
    Returns:
      The same instance of this `DocumentMetadata` class

  - ### getKey

    @Nonnull public String getKey()
    Metadata key name.
    Returns:
      key The key of this `DocumentMetadata` instance.

  - ### setKey

    public void setKey(@Nonnull String key)
    Set the key of this `DocumentMetadata` instance.
    Parameters:
      `key` - Metadata key name.

  - ### value

    @Nonnull public DocumentMetadata value(@Nullable List<String> value)
    Set the value of this `DocumentMetadata` instance and return the same instance.
    Parameters:
      `value` - An array of string values associated with the metadata key. If the key already exists, its values will be overwritten. Setting the value to null will delete the metadata key-value pair.
    Returns:
      The same instance of this `DocumentMetadata` class

  - ### addValueItem

    @Nonnull public DocumentMetadata addValueItem(@Nonnull String valueItem)
    Add one value instance to this `DocumentMetadata`.
    Parameters:
      `valueItem` - The value that should be added
    Returns:
      The same instance of type `DocumentMetadata`

  - ### getValue

    @Nullable public List<String> getValue()
    An array of string values associated with the metadata key. If the key already exists, its values will be overwritten. Setting the value to null will delete the metadata key-value pair.
    Returns:
      value The value of this `DocumentMetadata` instance.

  - ### setValue

    public void setValue(@Nullable List<String> value)
    Set the value of this `DocumentMetadata` instance.
    Parameters:
      `value` - An array of string values associated with the metadata key. If the key already exists, its values will be overwritten. Setting the value to null will delete the metadata key-value pair.

  - ### matchMode

    @Nonnull public DocumentMetadata matchMode(@Nullable DocumentMetadata.MatchModeEnum matchMode)
    Set the matchMode of this `DocumentMetadata` instance and return the same instance.
    Parameters:
      `matchMode` - Match mode for the metadata key (ANY or ALL).
    Returns:
      The same instance of this `DocumentMetadata` class

  - ### getMatchMode

    @Nullable public DocumentMetadata.MatchModeEnum getMatchMode()
    Match mode for the metadata key (ANY or ALL).
    Returns:
      matchMode The matchMode of this `DocumentMetadata` instance.

  - ### setMatchMode

    public void setMatchMode(@Nullable DocumentMetadata.MatchModeEnum matchMode)
    Set the matchMode of this `DocumentMetadata` instance.
    Parameters:
      `matchMode` - Match mode for the metadata key (ANY or ALL).

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `DocumentMetadata`.
    Returns:
      The set of properties names

  - ### getCustomField

    @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
    Deprecated.
    Use `toMap()` instead.
    Get the value of an unrecognizable property of this `DocumentMetadata` instance.
    Parameters:
      `name` - The name of the property
    Returns:
      The value of the property
    Throws:
      `NoSuchElementException` - If no property with the given name could be found.

  - ### toMap

    @Nonnull public Map<String,Object> toMap()
    Get the value of all properties of this `DocumentMetadata` instance including unrecognized properties.
    Returns:
      The map of all properties

  - ### setCustomField

    public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
    Set an unrecognizable property of this `DocumentMetadata` instance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
    Parameters:
      `customFieldName` - The name of the property
      `customFieldValue` - The value of the property

  - ### equals

    public boolean equals(@Nullable Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    @Nonnull public String toString()
    Overrides:
      `toString` in class `Object`

  - ### create

    public static DocumentMetadata.Builder create()
    Create a type-safe, fluent-api builder object to construct a new `DocumentMetadata` instance with all required arguments.