Class MutableObjectId

    • Constructor Detail

      • MutableObjectId

        public MutableObjectId()
        Empty constructor. Initialize object with default (zeros) value.
    • Method Detail

      • fromObjectId

        public void fromObjectId​(AnyObjectId src)
        Copy an ObjectId into this mutable buffer.
        Parameters:
        src - the source id to copy from.
      • fromRaw

        public void fromRaw​(byte[] bs)
        Convert an ObjectId from raw binary representation.
        Parameters:
        bs - the raw byte buffer to read from. At least 20 bytes must be available within this byte array.
      • fromRaw

        public void fromRaw​(byte[] bs,
                            int p)
        Convert an ObjectId from raw binary representation.
        Parameters:
        bs - the raw byte buffer to read from. At least 20 bytes after p must be available within this byte array.
        p - position to read the first byte of data from.
      • fromRaw

        public void fromRaw​(int[] ints)
        Convert an ObjectId from binary representation expressed in integers.
        Parameters:
        ints - the raw int buffer to read from. At least 5 integers must be available within this integers array.
      • fromRaw

        public void fromRaw​(int[] ints,
                            int p)
        Convert an ObjectId from binary representation expressed in integers.
        Parameters:
        ints - the raw int buffer to read from. At least 5 integers after p must be available within this integers array.
        p - position to read the first integer of data from.
      • set

        public void set​(int a,
                        int b,
                        int c,
                        int d,
                        int e)
        Convert an ObjectId from binary representation expressed in integers.
        Parameters:
        a - an int.
        b - an int.
        c - an int.
        d - an int.
        e - an int.
        Since:
        4.7
      • fromString

        public void fromString​(byte[] buf,
                               int offset)
        Convert an ObjectId from hex characters (US-ASCII).
        Parameters:
        buf - the US-ASCII buffer to read from. At least 40 bytes after offset must be available within this byte array.
        offset - position to read the first character from.
      • fromString

        public void fromString​(String str)
        Convert an ObjectId from hex characters.
        Parameters:
        str - the string to read from. Must be 40 characters long.
      • toObjectId

        public ObjectId toObjectId()
        Obtain an immutable copy of this current object name value.

        See AnyObjectId.copy() if this is a possibly subclassed (but immutable) identity and the application needs a lightweight identity only reference.

        Specified by:
        toObjectId in class AnyObjectId
        Returns:
        an immutable copy. May be this if this is already an immutable instance.