MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / GetText

Method GetText

client/field.go:74–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74func (f *Field) GetText() string {
75 if f.value == nil {
76 return ""
77 }
78 switch f.value.(type) {
79 case bool:
80 if f.value.(bool) {
81 return "true"
82 }
83 return "false"
84 case int32:
85 return int32ToString(f.value.(int32))
86 case int64:
87 return int64ToString(f.value.(int64))
88 case float32:
89 return float32ToString(f.value.(float32))
90 case float64:
91 return float64ToString(f.value.(float64))
92 case string:
93 return f.value.(string)
94 case []byte:
95 return bytesToHexString(f.value.([]byte))
96 case time.Time:
97 return f.value.(time.Time).Format("2006-01-02")
98 }
99 return ""
100}

Callers 1

TestField_GetTextFunction · 0.95

Calls 5

int32ToStringFunction · 0.85
int64ToStringFunction · 0.85
float32ToStringFunction · 0.85
float64ToStringFunction · 0.85
bytesToHexStringFunction · 0.85

Tested by 1

TestField_GetTextFunction · 0.76