public final class SqllrInput extends Object
NAMED: the caller names the unit by namespace + logicalName (for example a repository
and a path relative to it). This is the portable identity; the content digest only identifies the version.CONTENT_ADDRESSED: the caller declares that within contextDomain equal content is one
unit (for example entries of a query log).LOCAL: everything else, such as an unnamed file; valid only within the document. A producer never
makes an unnamed file content-addressed by itself.The text is analysed exactly as decoded: no character is replaced, a byte order mark is removed and declared
(BOM_STRIPPED), and line endings are kept (PRESERVED). Two inputs with equal text remain two
units. Immutable.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_ADDRESSED |
static String |
LOCAL |
static String |
NAMED |
| Modifier and Type | Method and Description |
|---|---|
static SqllrInput |
contentAddressed(String contextDomain,
String text)
A content-addressed unit: the caller declares that equal content within the domain is one unit.
|
String |
decodedTextDigest()
SHA-256 of the UTF-8 encoding of the decoded text (
DECODED_TEXT_SHA256). |
boolean |
equals(Object other)
Two inputs are equal only when they are the same object: equal text never merges two units.
|
String |
getBom()
NO_BOM or BOM_STRIPPED. |
String |
getContextDomain() |
String |
getIdentityKind() |
String |
getLogicalName() |
String |
getNamespace() |
byte[] |
getRawBytes()
The raw bytes, when given; a copy.
|
String |
getText()
The decoded text the analysis reads.
|
int |
hashCode() |
static SqllrInput |
local(byte[] utf8)
A unit with no identity beyond the document, from UTF-8 bytes.
|
static SqllrInput |
local(String text)
A unit with no identity beyond the document; the text is the whole content, with no byte order mark.
|
static SqllrInput |
local(String text,
String bom)
A unit with no identity beyond the document, declaring the byte order mark handling.
|
static SqllrInput |
named(String namespace,
String logicalName,
byte[] utf8)
A named unit from UTF-8 bytes; a leading byte order mark is removed and declared.
|
static SqllrInput |
named(String namespace,
String logicalName,
String text)
A named unit from already-decoded text that is the whole content of the source, with no byte order mark
(
NO_BOM); no raw-bytes digest is published. |
static SqllrInput |
named(String namespace,
String logicalName,
String text,
String bom)
A named unit from already-decoded text, declaring how a byte order mark was handled:
NO_BOM (the raw
bytes had none) or BOM_STRIPPED (the caller removed one; it is not part of the text). |
String |
rawBytesDigest()
SHA-256 of the raw bytes (
RAW_BYTES_SHA256), or null when only text was given. |
String |
toString() |
public static final String NAMED
public static final String CONTENT_ADDRESSED
public static final String LOCAL
public static SqllrInput named(String namespace, String logicalName, String text)
NO_BOM); no raw-bytes digest is published. Use named(String, String, String, String) when
the caller removed a byte order mark while decoding.public static SqllrInput named(String namespace, String logicalName, String text, String bom)
NO_BOM (the raw
bytes had none) or BOM_STRIPPED (the caller removed one; it is not part of the text).public static SqllrInput named(String namespace, String logicalName, byte[] utf8)
public static SqllrInput contentAddressed(String contextDomain, String text)
public static SqllrInput local(String text)
public static SqllrInput local(String text, String bom)
public static SqllrInput local(byte[] utf8)
public String getIdentityKind()
public String getNamespace()
public String getLogicalName()
public String getContextDomain()
public byte[] getRawBytes()
public String rawBytesDigest()
RAW_BYTES_SHA256), or null when only text was given.public String decodedTextDigest()
DECODED_TEXT_SHA256).public boolean equals(Object other)