All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.marklogic.client.util.NameMap Maven / Gradle / Ivy

The newest version!
/*
 * Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
 */
package com.marklogic.client.util;

import java.util.Map;

import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;

/**
 * A NameMap defines the interface for maps where the key is
 * a QName (a name qualified by a URI for global uniqueness or
 * for association with a domain).
 * @param 	the type for the values stored in the map
 */
public interface NameMap extends Map {
  /**
   * Returns the namespace context (if any) that declares the
   * namespace bindings used to convert prefixed string names
   * into QNames.
   * @return	the namespace context (if any)
   */
  NamespaceContext getNamespaceContext();
  /**
   * Specifies a namespace context that declares the
   * namespace bindings used to convert prefixed string names
   * into QNames.
   * @param context	the namespace context (if any)
   */
  void setNamespaceContext(NamespaceContext context);

  /**
   * Whether the map contains the string name as a key.
   * @param name	the key expressed as a string
   * @return	true if the map contains a QName equivalent to the key
   */
  boolean containsKey(String name);

  /**
   * Returns the value of the string name.
   * @param name	the key expressed as a string
   * @return	the value of the key or null if the key doesn't exist in the map
   */
  V get(String name);
  /**
   * Returns the value of the QName, cast to the supplied type.
   * @param name	the key
   * @param as	the type for the value
   * @param  the type for the value
   * @return	the value cast to the type
   */
   T get(QName name, Class as);
  /**
   * Returns the value of the string name, cast to the supplied type.
   * @param name	the key expressed as a string
   * @param as	the type for the value
   * @param  the type for the value
   * @return	the value cast to the type
   */
   T get(String name, Class as);

  /**
   * Specifies the value of the string name.
   * @param name	the key expressed as a string
   * @param value	the value of the key
   * @return	the previous value or null if the key did not have a value
   */
  V put(String name, V value);

  /**
   * Removes the key-value pair from the map.
   * @param name	the key expressed as a string
   * @return	the previous value or null if the key did not have a value
   */
  V remove(String name);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy