- java.lang.Object
-
- swim.codec.UtfErrorMode
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T> Output<T>
debug(Output<T> output)
Writes a developer readable, debug-formatted string representation of this object tooutput
.static UtfErrorMode
fatal()
Returns aUtfErrorMode
that aborts Unicode decoding with an error when invalid code unit sequences are encountered.static UtfErrorMode
fatalNonZero()
Returns aUtfErrorMode
that aborts Unicode decoding with an error when invalid code unit sequences, andNUL
bytes, are encountered.boolean
isFatal()
Returnstrue
if a Unicode decoding should abort with an error when an invalid code unit sequence is encountered.abstract boolean
isNonZero()
Returnstrue
if Unicode decoding should abort with an error when aNUL
byte is encountered.abstract UtfErrorMode
isNonZero(boolean isNonZero)
Returns aUtfErrorMode
that, ifisNonZero
istrue
, aborts when Unicode decoding encounters aNUL
byte.boolean
isReplacement()
Returnstrue
if a Unicode decoding should substitute invalid code unit sequences with a replacement character.static UtfErrorMode
replacement()
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the replacement character (U+FFFD
).static UtfErrorMode
replacement(int replacementChar)
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the givenreplacementChar
.int
replacementChar()
Returns the Unicode code point of the replacement character to substitute for invalid code unit sequences.static UtfErrorMode
replacementNonZero()
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the replacement character (U+FFFD
), and aborts decoding with an error whenNUL
bytes are encountered.static UtfErrorMode
replacementNonZero(int replacementChar)
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the givenreplacementChar
, and aborts decoding with an error whenNUL
bytes are encountered.String
toString()
-
-
-
Method Detail
-
isFatal
public boolean isFatal()
Returnstrue
if a Unicode decoding should abort with an error when an invalid code unit sequence is encountered.
-
isReplacement
public boolean isReplacement()
Returnstrue
if a Unicode decoding should substitute invalid code unit sequences with a replacement character.
-
replacementChar
public int replacementChar()
Returns the Unicode code point of the replacement character to substitute for invalid code unit sequences. Defaults toU+FFFD
.
-
isNonZero
public abstract boolean isNonZero()
Returnstrue
if Unicode decoding should abort with an error when aNUL
byte is encountered.
-
isNonZero
public abstract UtfErrorMode isNonZero(boolean isNonZero)
Returns aUtfErrorMode
that, ifisNonZero
istrue
, aborts when Unicode decoding encounters aNUL
byte.
-
debug
public abstract <T> Output<T> debug(Output<T> output)
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
.
-
fatal
public static UtfErrorMode fatal()
Returns aUtfErrorMode
that aborts Unicode decoding with an error when invalid code unit sequences are encountered.
-
fatalNonZero
public static UtfErrorMode fatalNonZero()
Returns aUtfErrorMode
that aborts Unicode decoding with an error when invalid code unit sequences, andNUL
bytes, are encountered.
-
replacement
public static UtfErrorMode replacement()
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the replacement character (U+FFFD
).
-
replacement
public static UtfErrorMode replacement(int replacementChar)
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the givenreplacementChar
.
-
replacementNonZero
public static UtfErrorMode replacementNonZero()
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the replacement character (U+FFFD
), and aborts decoding with an error whenNUL
bytes are encountered.
-
replacementNonZero
public static UtfErrorMode replacementNonZero(int replacementChar)
Returns aUtfErrorMode
that substitutes invalid code unit sequences with the givenreplacementChar
, and aborts decoding with an error whenNUL
bytes are encountered.
-
-