Class IndexEntryKey

  • All Implemented Interfaces:
    Serializable

    public final class IndexEntryKey
    extends Object
    implements Serializable
    An IndexEntryKey uniquely identifies an entry in the indexes. An IndexEntryKey is set at the index entry creation time : when a Silverpeas component adds a new element or document. This IndexEntryKey will be returned later when the document matches a query. A document in Silverpeas is uniquely identified by:
    • the space name where the element has been created. This space name may be a user id when the space is the private working space of this user.
    • The component name which handles the element. This component name may be an instance name when several instances of the same component live in the same space.
    • The object type. The meaning of this type is uniquely determined by the component which handles the object.
    • The object id.
    See Also:
    Serialized Form
    • Constructor Detail

      • IndexEntryKey

        public IndexEntryKey​(String componentId,
                             String objectType,
                             String objectId)
    • Method Detail

      • create

        public static IndexEntryKey create​(String s)
        Create a new IndexEntry from s. We must have :
         create(s).toString().equals(s)
         
      • getComponent

        public String getComponent()
        Return the name of the component's instance which handles the object.
      • getObjectType

        public String getObjectType()
        Return the type of the indexed document. The meaning of this type is uniquely determined by the component handling the object.
      • getObjectId

        public String getObjectId()
        Return the object id.
      • toString

        public String toString()
        Returns a string which can be used later to recontruct the key with the create method.
        Overrides:
        toString in class Object
      • equals

        public boolean equals​(Object o)
        To be equal two IndexEntryKey must have the same four parts (space, component, type, id). The equals method is redefined so IndexEntryKey objects can be put in a Set or used as Map key.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Returns the hash code of the String representation. The hashCode method is redefined so IndexEntryKey objects can be put in a Set or used as Map key.
        Overrides:
        hashCode in class Object