Package com.fauna.codec
Enum FaunaTokenType
- java.lang.Object
-
- java.lang.Enum<FaunaTokenType>
-
- com.fauna.codec.FaunaTokenType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<FaunaTokenType>
public enum FaunaTokenType extends java.lang.Enum<FaunaTokenType>
Enumeration representing token types for Fauna serialization.The
FaunaTokenTypeenum defines various tokens that are used to identify different elements and data structures within FQL serialization and deserialization processes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BYTESA value token that represents a Fauna base64-encoded byte sequence.DATEA value token that represents a Fauna date.DOUBLEA value token that represents a Fauna double.END_ARRAYA structural token that ends an array.END_DOCUMENTA structural token that ends a document.END_OBJECTA structural token that ends an object.END_PAGEA structural token that ends a page.END_REFA structural token that ends a ref.FALSEA value token that represents the Fauna booleanfalse.FIELD_NAMEA value token that represents a field of an Fauna object, document, or other structure.INTA value token that represents a Fauna integer.LONGA value token that represents a Fauna long.MODULEA value token that represents a Fauna symbolic object, such as a user collection.NONENULLA value token that represents null.START_ARRAYA structural token that starts an array.START_DOCUMENTA structural token that starts a document.START_OBJECTA structural token that starts an object.START_PAGEA structural token that starts a page.START_REFA structural token that starts a ref.STREAMA value token that represents a Fauna Event Source.STRINGA value token that represents a Fauna string.TIMEA value token that represents a Fauna time.TRUEA value token that represents the Fauna booleantrue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FaunaTokenTypegetEndToken()Returns the corresponding end token for the current start token.FaunaTypegetFaunaType()Returns theFaunaTypethat corresponds to the currentFaunaTokenType.static FaunaTokenTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static FaunaTokenType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final FaunaTokenType NONE
-
START_OBJECT
public static final FaunaTokenType START_OBJECT
A structural token that starts an object. Wire representation:{
-
END_OBJECT
public static final FaunaTokenType END_OBJECT
A structural token that ends an object. Wire representation:}
-
START_ARRAY
public static final FaunaTokenType START_ARRAY
A structural token that starts an array. Wire representation:[
-
END_ARRAY
public static final FaunaTokenType END_ARRAY
A structural token that ends an array. Wire representation:]
-
START_PAGE
public static final FaunaTokenType START_PAGE
A structural token that starts a page. Wire representation:{ "@page":
-
END_PAGE
public static final FaunaTokenType END_PAGE
A structural token that ends a page. Wire representation:}
-
START_REF
public static final FaunaTokenType START_REF
A structural token that starts a ref. Wire representation:{ "@ref":
-
END_REF
public static final FaunaTokenType END_REF
A structural token that ends a ref. Wire representation:}
-
START_DOCUMENT
public static final FaunaTokenType START_DOCUMENT
A structural token that starts a document. Wire representation:{ "@doc":
-
END_DOCUMENT
public static final FaunaTokenType END_DOCUMENT
A structural token that ends a document. Wire representation:}
-
FIELD_NAME
public static final FaunaTokenType FIELD_NAME
A value token that represents a field of an Fauna object, document, or other structure.
-
STRING
public static final FaunaTokenType STRING
A value token that represents a Fauna string.
-
BYTES
public static final FaunaTokenType BYTES
A value token that represents a Fauna base64-encoded byte sequence.
-
INT
public static final FaunaTokenType INT
A value token that represents a Fauna integer.
-
LONG
public static final FaunaTokenType LONG
A value token that represents a Fauna long.
-
DOUBLE
public static final FaunaTokenType DOUBLE
A value token that represents a Fauna double.
-
DATE
public static final FaunaTokenType DATE
A value token that represents a Fauna date.
-
TIME
public static final FaunaTokenType TIME
A value token that represents a Fauna time.
-
TRUE
public static final FaunaTokenType TRUE
A value token that represents the Fauna booleantrue.
-
FALSE
public static final FaunaTokenType FALSE
A value token that represents the Fauna booleanfalse.
-
NULL
public static final FaunaTokenType NULL
A value token that represents null.
-
STREAM
public static final FaunaTokenType STREAM
A value token that represents a Fauna Event Source.
-
MODULE
public static final FaunaTokenType MODULE
A value token that represents a Fauna symbolic object, such as a user collection.
-
-
Method Detail
-
values
public static FaunaTokenType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FaunaTokenType c : FaunaTokenType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FaunaTokenType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getEndToken
public FaunaTokenType getEndToken()
Returns the corresponding end token for the current start token.For tokens representing the beginning of a structure (e.g.,
START_OBJECT), this method returns the matching token for the end of that structure (e.g.,END_OBJECT).- Returns:
- The end token associated with the current start token.
- Throws:
ClientResponseException- If the current token has no corresponding end token.
-
getFaunaType
public FaunaType getFaunaType()
Returns theFaunaTypethat corresponds to the currentFaunaTokenType.This method maps each token type in
FaunaTokenTypeto a specificFaunaType, which represents the underlying data type in Fauna's type system.- Returns:
- The
FaunaTypeassociated with the current token type. - Throws:
java.lang.IllegalStateException- If the token type does not have an associatedFaunaType.
-
-