Class Uid

  • public final class Uid
    extends java.lang.Object
    • Constructor Summary

      Constructor Description
      Uid​(java.lang.String type, java.lang.String id)  
    • Method Summary

      Modifier and Type Method Description
      static Uid createUid​(java.lang.String uid)  
      static java.lang.String createUid​(java.lang.String type, java.lang.String id)  
      static org.apache.lucene.util.BytesRef createUidAsBytes​(java.lang.String type, java.lang.String id)  
      static org.apache.lucene.util.BytesRef createUidAsBytes​(java.lang.String type, org.apache.lucene.util.BytesRef id)  
      static org.apache.lucene.util.BytesRef createUidAsBytes​(org.apache.lucene.util.BytesRef type, org.apache.lucene.util.BytesRef id)  
      static org.apache.lucene.util.BytesRef[] createUidsForTypesAndId​(java.util.Collection<java.lang.String> types, java.lang.Object id)  
      static org.apache.lucene.util.BytesRef[] createUidsForTypesAndIds​(java.util.Collection<java.lang.String> types, java.util.Collection<?> ids)  
      static java.lang.String decodeId​(byte[] idBytes)
      Decode an indexed id back to its original form.
      static java.lang.String decodeId​(byte[] idBytes, int offset, int length)
      Decode an indexed id back to its original form.
      static org.apache.lucene.util.BytesRef encodeId​(java.lang.String id)
      Encode an id for storage in the index.
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String id()  
      org.apache.lucene.util.BytesRef toBytesRef()  
      java.lang.String toString()  
      java.lang.String type()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Uid

        public Uid​(java.lang.String type,
                   java.lang.String id)
    • Method Detail

      • type

        public java.lang.String type()
      • id

        public java.lang.String id()
      • equals

        public boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • toBytesRef

        public org.apache.lucene.util.BytesRef toBytesRef()
      • createUid

        public static Uid createUid​(java.lang.String uid)
      • createUidAsBytes

        public static org.apache.lucene.util.BytesRef createUidAsBytes​(java.lang.String type,
                                                                       java.lang.String id)
      • createUidAsBytes

        public static org.apache.lucene.util.BytesRef createUidAsBytes​(java.lang.String type,
                                                                       org.apache.lucene.util.BytesRef id)
      • createUidAsBytes

        public static org.apache.lucene.util.BytesRef createUidAsBytes​(org.apache.lucene.util.BytesRef type,
                                                                       org.apache.lucene.util.BytesRef id)
      • createUidsForTypesAndId

        public static org.apache.lucene.util.BytesRef[] createUidsForTypesAndId​(java.util.Collection<java.lang.String> types,
                                                                                java.lang.Object id)
      • createUidsForTypesAndIds

        public static org.apache.lucene.util.BytesRef[] createUidsForTypesAndIds​(java.util.Collection<java.lang.String> types,
                                                                                 java.util.Collection<?> ids)
      • createUid

        public static java.lang.String createUid​(java.lang.String type,
                                                 java.lang.String id)
      • encodeId

        public static org.apache.lucene.util.BytesRef encodeId​(java.lang.String id)
        Encode an id for storage in the index. This encoding is optimized for numeric and base64 ids, which are encoded in a much denser way than what UTF8 would do.
        See Also:
      • decodeId

        public static java.lang.String decodeId​(byte[] idBytes)
        Decode an indexed id back to its original form.
        See Also:
      • decodeId

        public static java.lang.String decodeId​(byte[] idBytes,
                                                int offset,
                                                int length)
        Decode an indexed id back to its original form.
        See Also: