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

Function getBasicJavaName

protocol/dubbo/hessian2/java_class.go:82–109  ·  view source on GitHub ↗
(typ reflect.Type)

Source from the content-addressed store, hash-verified

80}
81
82func getBasicJavaName(typ reflect.Type) (string, error) {
83 switch typ.Kind() {
84 case reflect.Bool:
85 return "boolean", nil
86 case reflect.Int, reflect.Int64: // in 64-bit processor, Int takes a 64-bit space
87 return "long", nil
88 case reflect.Int32:
89 return "int", nil
90 case reflect.Int8, reflect.Int16:
91 return "short", nil
92 case reflect.Uint, reflect.Uint64: // in 64-bit processor, Uint takes a 64-bit space
93 return "unsigned long", nil
94 case reflect.Uint32:
95 return "unsigned int", nil
96 case reflect.Uint16:
97 return "unsigned short", nil
98 case reflect.Uint8:
99 return "char", nil
100 case reflect.Float32:
101 return "float", nil
102 case reflect.Float64:
103 return "double", nil
104 case reflect.String:
105 return "java.lang.String", nil
106 }
107
108 return "", notBasicClassError
109}
110
111// GetClassDesc get class desc.
112// - boolean[].class => "[Z"

Callers 1

GetJavaNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected