Class KeyUtility


  • public class KeyUtility
    extends java.lang.Object
    Some utilities for key handling.
    Since:
    1.0
    Version:
    $Id: $Id
    Author:
    another
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getDocumentName​(java.lang.String key)
      Extracts the name of the document from the key.
      static java.lang.String getDocumentType​(java.lang.String key)
      Extracts the name of the document type (document or list) from the key.
      static java.lang.String getKeyFromListKey​(java.lang.String listKey)
      Extracts the document key from the given listkey.
      static java.lang.String getListPos​(java.lang.String listKey)
      getListPos.
      static boolean isDocument​(java.lang.String key)
      isDocument.
      static boolean isList​(java.lang.String key)
      isList.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDocumentType

        public static java.lang.String getDocumentType​(java.lang.String key)
        Extracts the name of the document type (document or list) from the key.
        Parameters:
        key - a String object.
        Returns:
        name of the document type
      • getDocumentName

        public static java.lang.String getDocumentName​(java.lang.String key)
        Extracts the name of the document from the key.
        Parameters:
        key - a String object.
        Returns:
        name of the document
      • isDocument

        public static boolean isDocument​(java.lang.String key)

        isDocument.

        Parameters:
        key - a String object.
        Returns:
        true if the given key represents a document (contains document identifier in the key).
      • isList

        public static boolean isList​(java.lang.String key)

        isList.

        Parameters:
        key - a String object.
        Returns:
        true if the given key represents a list (contains list identifier in the key).
      • getListPos

        public static java.lang.String getListPos​(java.lang.String listKey)

        getListPos.

        Parameters:
        listKey - a String object.
        Returns:
        the position of the current document from the listkey.
      • getKeyFromListKey

        public static java.lang.String getKeyFromListKey​(java.lang.String listKey)
        Extracts the document key from the given listkey.
        Parameters:
        listKey - is a document key combined with the list position.
        Returns:
        document key