Package io.bdeploy.bhive.model
Class ObjectId
java.lang.Object
io.bdeploy.bhive.model.ObjectId
- All Implemented Interfaces:
Serializable,Comparable<ObjectId>
Uniquely identifies a certain object. That is (typically) the content of an
arbitrary file which has been imported into the hive or a
Tree.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintstatic ObjectIdcreate(byte[] data, int offset, int len) Create anObjectIdby calculating the ID of the given content.static ObjectIdcreateByCopy(InputStream source, Path target) Create anObjectIdby calculating the ID of the content of the given sourceInputStream.static ObjectIdcreateFromStreamNoCopy(InputStream source) Creates anObjectIdby calculating the ID of the content of the givenInputStream.booleangetId()inthashCode()static ObjectIdtoString()
-
Method Details
-
getId
- Returns:
- the
Stringrepresentation of this ID.
-
parse
-
create
Create anObjectIdby calculating the ID of the given content. -
createByCopy
Create anObjectIdby calculating the ID of the content of the given sourceInputStream. While doing so, copy the content to the given targetPathas well.- Throws:
IOException
-
createFromStreamNoCopy
Creates anObjectIdby calculating the ID of the content of the givenInputStream.This method is meant for validation purposes only. To create objects in the database use
createByCopy(InputStream, Path)as this copies the data while hashing. -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<ObjectId>
-
hashCode
@Generated("Eclipse") public int hashCode() -
equals
-