MCPcopy Create free account
hub / github.com/apache/dubbo-go-hessian2 / SetCollectionSerialize

Function SetCollectionSerialize

java_collection.go:36–51  ·  view source on GitHub ↗
(collection JavaCollectionObject)

Source from the content-addressed store, hash-verified

34var collectionTypeMap = make(map[string]reflect.Type, 16)
35
36func SetCollectionSerialize(collection JavaCollectionObject) {
37 name := collection.JavaClassName()
38 v := reflect.ValueOf(collection)
39 var typ reflect.Type
40 switch v.Kind() {
41 case reflect.Struct:
42 typ = v.Type()
43 case reflect.Ptr:
44 typ = v.Elem().Type()
45 default:
46 typ = reflect.TypeOf(collection)
47 }
48 SetSerializer(name, JavaCollectionSerializer{})
49 RegisterPOJO(collection)
50 collectionTypeMap[name] = typ
51}
52
53func getCollectionSerialize(name string) reflect.Type {
54 return collectionTypeMap[name]

Callers 1

initFunction · 0.85

Calls 4

SetSerializerFunction · 0.85
RegisterPOJOFunction · 0.85
JavaClassNameMethod · 0.65
ValueOfMethod · 0.65

Tested by 1

initFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…