-
Notifications
You must be signed in to change notification settings - Fork 0
/
int64.go
68 lines (52 loc) · 1.15 KB
/
int64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package property
import "github.com/benpate/rosetta/convert"
type Int64 int64
func (value Int64) IsInt() bool {
return true
}
func (value Int64) IsInt64() bool {
return true
}
func (value Int64) Int() int {
return int(value)
}
func (value Int64) Int64() int64 {
return int64(value)
}
// Get returns a value of the given property
func (value Int64) Get(_ string) Value {
return Nil{}
}
// Set returns the value with the given property set
func (value Int64) Set(propertyName string, propertyValue any) Value {
return Map{
propertyName: propertyValue,
}
}
// Head returns the first value in a slice
func (value Int64) Head() Value {
return value
}
// Tail returns all values in a slice except the first
func (value Int64) Tail() Value {
return Nil{}
}
// Len returns the number of elements in the value
func (value Int64) Len() int {
return 1
}
func (value Int64) IsNil() bool {
return value == 0
}
func (value Int64) String() string {
return convert.String(value)
}
func (value Int64) Map() map[string]any {
return make(map[string]any)
}
func (value Int64) Raw() any {
return int64(value)
}
func (value Int64) Clone() Value {
return value
}