Package convex.core.data
Class Strings
java.lang.Object
convex.core.data.Strings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringShort
static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final Ref
<StringShort> static final byte
Byte value used for looking outside a String 0xff (-1) is invalid UTF-8static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final int
static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final StringShort
static final StringShort
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AString
static AString
static AString
static AString
Create a canonical CVM String from a regular Java Stringstatic StringShort
empty()
static AString
Constructs a UTF-8 CVM String from raw hex digits.static CharsetDecoder
static AString
Creates a string by joining a sequence of substrings with the given separatorstatic AString
Creates a String by joining a sequence of substrings with the given separatorstatic AString
Reads a String from a Blob encoding.
-
Field Details
-
EMPTY
-
EMPTY_REF
-
NIL
-
TRUE
-
FALSE
-
BAD_SIGNATURE
-
BAD_FORMAT
-
SERVER_LOADED
-
COLON
-
HEX_PREFIX
-
MAX_ENCODING_LENGTH
public static final int MAX_ENCODING_LENGTH -
EXCESS_BYTE
public static final byte EXCESS_BYTEByte value used for looking outside a String 0xff (-1) is invalid UTF-8- See Also:
-
MISSING_PEER
-
INSUFFICIENT_STAKE
-
ILLEGAL_BLOCK_SIZE
-
BACKDATED_BLOCK
-
MISORDERED_BLOCK
-
NO_SUCH_ACCOUNT
-
NO_TX_FOR_ACTOR
-
WRONG_KEY
-
OLD_SEQUENCE
-
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
read
Reads a String from a Blob encoding.- Parameters:
blob
- Blob to read fromoffset
- Offset within blob- Returns:
- String instance
- Throws:
BadFormatException
- If any problem with encoding
-
create
-
create
-
join
Creates a string by joining a sequence of substrings with the given separator- Parameters:
ss
- Sequence of Strings to joinseparator
- any String to use as a separator.- Returns:
- Concatenated String, including the separator. Will return the empty string if the seqence is empty.
-
join
Creates a String by joining a sequence of substrings with the given separator- Parameters:
ss
- Sequence of Strings to joinseparator
- any CVM Character to use as a separator.- Returns:
- Concatenated String, including the separator. Will return the empty string if the sequence is empty.
-
create
-
fromHex
Constructs a UTF-8 CVM String from raw hex digits. This does not perform checking of valid UTF: It is possible to construct bad strings this way. This is allowable on the CVM, and useful for testing.- Parameters:
hexString
- String containing hex digits- Returns:
- New CVM String (possibly not valid UTF)
-
empty
-
getDecoder
-
appendAll
-