Interface ChangeToken
ReadableResource.changeToken().
This is named a "change token" and not "version" (or "revision") because that might imply something “numeric” - but this is explicitly NOT intended to be used for “is it newer or older” comparison, only “has it changed”. It's also not called a "fingerprint" because that might imply it's derived only from the content itself (like a hash), whereas this may be based on more than that, e.g. additional metadata.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChangeTokenConstant (singleton) for "not available" change tokens. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisDifferent(ChangeToken other) Check is this ChangeToken is different from that other ChangeToken.toBytes()toString()String representation of this ChangeToken, (only) forReadableResource.isDifferent(String).
-
Field Details
-
NOT_AVAILABLE
Constant (singleton) for "not available" change tokens.Returned by
ReadableResource.changeToken()when it's impossible to obtain aChangeTokene.g. due to internal technical errors, including because the URI points to a non-existing resource. ItsisDifferent(ChangeToken)always returns true.
-
-
Method Details
-
isDifferent
Check is this ChangeToken is different from that other ChangeToken.If it's not sure, prefer "erring on the side of caution" by returning true instead of false. That's why two
NOT_AVAILABLEare considered representing (possibly) different resource contents (returns true). -
toString
String representation of this ChangeToken, (only) forReadableResource.isDifferent(String).Do not interpret the content of this String. It's intended to be used completely "opaque", and only for before & after comparison, on a Resource from the same URI. Implementations are encouraged to return strings which do not (directly) "look like something familiar", to avoid users relying on implementation details.
-
toBytes
-