Class Brightzone\GremlinDriver\Serializers\Gson3

InheritanceBrightzone\GremlinDriver\Serializers\Gson3
ImplementsBrightzone\GremlinDriver\Serializers\SerializerInterface

Gremlin-server PHP JSON Serializer class Builds and parses message body for Messages class

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$mimeType integer Value of this serializer. Brightzone\GremlinDriver\Serializers\Gson3
$name string The name of the serializer Brightzone\GremlinDriver\Serializers\Gson3

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$supportedFromTypes array The native supported types that the serializer can convert to graphson Brightzone\GremlinDriver\Serializers\Gson3
$supportedGSTypes array The GraphSON supported types that the serializer can deconvert from Brightzone\GremlinDriver\Serializers\Gson3

Public Methods

Hide inherited methods

MethodDescriptionDefined By
convert() Transforms a variable into it's graphson 3.0 counterpart structure Brightzone\GremlinDriver\Serializers\Gson3
convertArray() Convert an array into it's corresponding graphson 3.0 form(List or Map) This differentiates between Maps and Lists (we do not convert to Set) Brightzone\GremlinDriver\Serializers\Gson3
convertBoolean() Convert a boolean into it's graphson 3.0 form Brightzone\GremlinDriver\Serializers\Gson3
convertDouble() Convert an float/double into it's graphson 3.0 form Brightzone\GremlinDriver\Serializers\Gson3
convertInteger() Convert an integer into it's graphson 3.0 form Brightzone\GremlinDriver\Serializers\Gson3
convertList() Convert an array into a graphson 3.0 List Brightzone\GremlinDriver\Serializers\Gson3
convertMap() Convert an array into a graphson 3.0 Map Brightzone\GremlinDriver\Serializers\Gson3
convertNULL() Convert a NULL into it's graphson 3.0 form Brightzone\GremlinDriver\Serializers\Gson3
convertObject() Convert an object into a graphson 3.0 Map Currently unsuported Brightzone\GremlinDriver\Serializers\Gson3
convertString() Convert a string into it's graphson 3.0 form Brightzone\GremlinDriver\Serializers\Gson3
deconvert() Transforms a graphson 3.0 "variable" into it's native structure Brightzone\GremlinDriver\Serializers\Gson3
deconvertClass() Deconvert a Class into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertDate() Deconvert a Date into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertDouble() Deconvert a Double into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertEdge() Deconvert a Edge into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertFloat() Deconvert a Float into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertInt32() Deconvert an Int32 into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertInt64() Deconvert an Int64 into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertList() Deconvert a List into it's native form (Array) Brightzone\GremlinDriver\Serializers\Gson3
deconvertMap() Deconvert a Map into it's native form (Array) Brightzone\GremlinDriver\Serializers\Gson3
deconvertPath() Deconvert a Path into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertProperty() Deconvert a Property into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertSet() Deconvert a Set into it's native form (Array) Brightzone\GremlinDriver\Serializers\Gson3
deconvertT() Deconvert a Token (T) into it's string form Brightzone\GremlinDriver\Serializers\Gson3
deconvertTimestamp() Deconvert a Timestamp into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertTinkergraph() Deconvert a TinkerGraph into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertTree() Deconvert a Tree into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertUUID() Deconvert a UUID into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertVertex() Deconvert a Vertex into it's native form Brightzone\GremlinDriver\Serializers\Gson3
deconvertVertexProperty() Deconvert a VertexProperty into it's native form Brightzone\GremlinDriver\Serializers\Gson3
getMimeType() Get this serializer's value This will be deprecated with TP3 Gremlin-server Brightzone\GremlinDriver\Serializers\Gson3
getName() Get this serializer's Name Brightzone\GremlinDriver\Serializers\Gson3
serialize() Serializes the data Brightzone\GremlinDriver\Serializers\Gson3
unserialize() Unserializes the data Brightzone\GremlinDriver\Serializers\Gson3

Property Details

$mimeType public static property

Value of this serializer. Will be deprecated in TP3

public static integer $mimeType 'application/json'
$name public static property

The name of the serializer

public static string $name 'GRAPHSON3'
$supportedFromTypes protected static property

The native supported types that the serializer can convert to graphson

protected static array $supportedFromTypes = ["string""boolean""double""integer""array""object""NULL"]
$supportedGSTypes protected static property

The GraphSON supported types that the serializer can deconvert from

protected static array $supportedGSTypes = ["g:Int32""g:Int64""g:Date""g:Timestamp""g:UUID""g:Float""g:Double""g:List""g:Map""g:Set""g:Class""g:Path""g:Tree""g:Vertex""g:VertexProperty""tinker:graph""g:Edge""g:Property""g:T"]

Method Details

convert() public method

Transforms a variable into it's graphson 3.0 counterpart structure

public array|string convert ( $item )
$item mixed

The variable to convert to the graphson 3 structure

return array|string

The same element in it's new form.

throws Brightzone\GremlinDriver\InternalException
convertArray() public method

Convert an array into it's corresponding graphson 3.0 form(List or Map) This differentiates between Maps and Lists (we do not convert to Set)

public array convertArray ( $array )
$array array

The array to convert

return array

Converted array

throws Brightzone\GremlinDriver\InternalException
convertBoolean() public method

Convert a boolean into it's graphson 3.0 form

public boolean convertBoolean ( $bool )
$bool boolean

The boolean to convert

return boolean

Converted boolean (same as original)

convertDouble() public method

Convert an float/double into it's graphson 3.0 form

public array convertDouble ( $double )
$double double

The float/double to convert

return array

Converted double

convertInteger() public method

Convert an integer into it's graphson 3.0 form

public array convertInteger ( $int )
$int integer

The integer to convert

return array

Converted integer

convertList() public method

Convert an array into a graphson 3.0 List

public array convertList ( $array )
$array array

The array to convert

return array

Converted to GS3 List

throws Brightzone\GremlinDriver\InternalException
convertMap() public method

Convert an array into a graphson 3.0 Map

public array convertMap ( $array )
$array array

The array to convert

return array

Converted to GS3 Map

throws Brightzone\GremlinDriver\InternalException
convertNULL() public method

Convert a NULL into it's graphson 3.0 form

public null convertNULL ( $null )
$null null

The NULL to convert

return null

Converted NULL

convertObject() public method

Convert an object into a graphson 3.0 Map Currently unsuported

public array convertObject ( $object )
$object object

The array to convert

return array

The converted object

throws Brightzone\GremlinDriver\InternalException
convertString() public method

Convert a string into it's graphson 3.0 form

public string convertString ( $string )
$string string

The string to convert

return string

Converted string (same as original currently)

deconvert() public method

Transforms a graphson 3.0 "variable" into it's native structure

public mixed deconvert ( $item )
$item mixed

The variable to convert to php native

return mixed

The same element in it's new form.

throws Brightzone\GremlinDriver\InternalException
deconvertClass() public method

Deconvert a Class into it's native form

public void deconvertClass ( $classname )
$classname string

The class to convert

throws Brightzone\GremlinDriver\InternalException
deconvertDate() public method

Deconvert a Date into it's native form

public integer deconvertDate ( $date )
$date integer

The date to convert

return integer

Deconverted Date

deconvertDouble() public method

Deconvert a Double into it's native form

public double deconvertDouble ( $double )
$double double

The double to convert

return double

Deconverted Double

deconvertEdge() public method

Deconvert a Edge into it's native form

public array deconvertEdge ( $edge )
$edge array

The Edge to convert

return array

Deconverted Edge

throws Brightzone\GremlinDriver\InternalException
deconvertFloat() public method

Deconvert a Float into it's native form

public double deconvertFloat ( $float )
$float double

The float to convert

return double

Deconverted Float

deconvertInt32() public method

Deconvert an Int32 into it's native form

public integer deconvertInt32 ( $int )
$int integer

The int to convert

return integer

Deconverted Int32

deconvertInt64() public method

Deconvert an Int64 into it's native form

public integer deconvertInt64 ( $int )
$int integer

The int to convert

return integer

Deconverted Int64

throws Brightzone\GremlinDriver\InternalException
deconvertList() public method

Deconvert a List into it's native form (Array)

public array deconvertList ( $list )
$list array

The List to convert

return array

Deconverted List

throws Brightzone\GremlinDriver\InternalException
deconvertMap() public method

Deconvert a Map into it's native form (Array)

public array deconvertMap ( $map )
$map array

The Map to convert

return array

Deconverted Map

throws Brightzone\GremlinDriver\InternalException
deconvertPath() public method

Deconvert a Path into it's native form

public array deconvertPath ( $path )
$path array

The Path to convert

return array

Deconverted Path

throws Brightzone\GremlinDriver\InternalException
deconvertProperty() public method

Deconvert a Property into it's native form

public mixed deconvertProperty ( $prop )
$prop array

The Property to convert

return mixed

Deconverted Property

throws Brightzone\GremlinDriver\InternalException
deconvertSet() public method

Deconvert a Set into it's native form (Array)

public array deconvertSet ( $set )
$set array

The Set to convert

return array

Deconverted Set

throws Brightzone\GremlinDriver\InternalException
deconvertT() public method

Deconvert a Token (T) into it's string form

public string deconvertT ( $t )
$t string

The token to deconvert

return string

Either "id" or "label"

deconvertTimestamp() public method

Deconvert a Timestamp into it's native form

public integer deconvertTimestamp ( $timestamp )
$timestamp integer

The Timestamp to convert

return integer

Deconverted Timestamp

deconvertTinkergraph() public method

Deconvert a TinkerGraph into it's native form

public array deconvertTinkergraph ( $tinkergraph )
$tinkergraph array

The TinkerGraph to convert

return array

Deconverted TinkerGraph

throws Brightzone\GremlinDriver\InternalException
deconvertTree() public method

Deconvert a Tree into it's native form

public array deconvertTree ( $tree )
$tree array

The Tree to convert

return array

Deconverted Tree

throws Brightzone\GremlinDriver\InternalException
deconvertUUID() public method

Deconvert a UUID into it's native form

public string deconvertUUID ( $uuid )
$uuid string

The UUID to convert

return string

Deconverted UUID

deconvertVertex() public method

Deconvert a Vertex into it's native form

public array deconvertVertex ( $vertex )
$vertex array

The Vertex to convert

return array

Deconverted Vertex

throws Brightzone\GremlinDriver\InternalException
deconvertVertexProperty() public method

Deconvert a VertexProperty into it's native form

public mixed deconvertVertexProperty ( $vertexProp )
$vertexProp array

The VertexProperty to convert

return mixed

Deconverted VertexProperty

throws Brightzone\GremlinDriver\InternalException
getMimeType() public method

Get this serializer's value This will be deprecated with TP3 Gremlin-server

public string getMimeType ( )
return string

Name of serializer

getName() public method

Get this serializer's Name

public string getName ( )
return string

Name of serializer

serialize() public method

Serializes the data

public integer serialize ( &$data )
$data
return integer

Length of generated string

throws Brightzone\GremlinDriver\InternalException
unserialize() public method

Unserializes the data

public array unserialize ( $data )
$data mixed

Data to be unserialized

return array

Unserialized message

throws Brightzone\GremlinDriver\InternalException