-
Notifications
You must be signed in to change notification settings - Fork 1
/
map_enumerable.generated.go
87 lines (67 loc) · 2.52 KB
/
map_enumerable.generated.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// This code was generated by a tool.
package enu
type MapEnumerable[K comparable, V any] struct {
enumerator IEnumerator[KeyValuePair[K, V]]
}
func NewMap[K comparable, V any](e IEnumerator[KeyValuePair[K, V]]) *MapEnumerable[K, V] {
return &MapEnumerable[K, V]{enumerator: e}
}
func (e *MapEnumerable[K, V]) Each(iteratee func(KeyValuePair[K, V], int)) *MapEnumerable[K, V] {
each[KeyValuePair[K, V]](e, func(item KeyValuePair[K, V], index int) bool {
iteratee(item, index)
return true
})
return e
}
func (e *MapEnumerable[K, V]) ToSlice() []KeyValuePair[K, V] {
return ToSlice[KeyValuePair[K, V]](e)
}
func (e *MapEnumerable[K, V]) Count() int {
return Count[KeyValuePair[K, V]](e)
}
func (e *MapEnumerable[K, V]) Filter(predicate func(KeyValuePair[K, V], int) bool) *MapEnumerable[K, V] {
return NewMap[K, V](Filter[KeyValuePair[K, V]](e, predicate))
}
func (e *MapEnumerable[K, V]) Nth(nth int) (KeyValuePair[K, V], bool) {
return Nth[KeyValuePair[K, V]](e, nth)
}
func (e *MapEnumerable[K, V]) Find(predicate func(KeyValuePair[K, V], int) bool) (KeyValuePair[K, V], bool) {
return Find[KeyValuePair[K, V]](e, predicate)
}
func (e *MapEnumerable[K, V]) First() (KeyValuePair[K, V], bool) {
return First[KeyValuePair[K, V]](e)
}
func (e *MapEnumerable[K, V]) Last() (KeyValuePair[K, V], bool) {
return Last[KeyValuePair[K, V]](e)
}
func (e *MapEnumerable[K, V]) Reverse() *MapEnumerable[K, V] {
return NewMap[K, V](Reverse[KeyValuePair[K, V]](e))
}
func (e *MapEnumerable[K, V]) SortBy(sorter func(i, j KeyValuePair[K, V]) bool) *MapEnumerable[K, V] {
return NewMap[K, V](SortBy[KeyValuePair[K, V]](e, sorter))
}
func (e *MapEnumerable[K, V]) Reject(predicate func(KeyValuePair[K, V], int) bool) *MapEnumerable[K, V] {
return NewMap[K, V](Reject[KeyValuePair[K, V]](e, predicate))
}
func (e *MapEnumerable[K, V]) IsAll(predicate func(KeyValuePair[K, V]) bool) bool {
return IsAll[KeyValuePair[K, V]](e, predicate)
}
func (e *MapEnumerable[K, V]) IsAny(predicate func(KeyValuePair[K, V]) bool) bool {
return IsAny[KeyValuePair[K, V]](e, predicate)
}
func (e *MapEnumerable[K, V]) Take(num int) *MapEnumerable[K, V] {
return NewMap[K, V](Take[KeyValuePair[K, V]](e, num))
}
func (e *MapEnumerable[K, V]) Result(out *[]KeyValuePair[K, V]) *MapEnumerable[K, V] {
Result[KeyValuePair[K, V]](e, out)
return e
}
func (e *MapEnumerable[K, V]) Err() error {
if p, ok := e.enumerator.(ErrorProvider); ok {
return p.Err()
}
return nil
}
func (e *MapEnumerable[K, V]) GetEnumerator() IEnumerator[KeyValuePair[K, V]] {
return e.enumerator
}