-
Notifications
You must be signed in to change notification settings - Fork 457
/
arpvalidate_enumer.go
63 lines (51 loc) · 1.69 KB
/
arpvalidate_enumer.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
// Code generated by "enumer -type=ARPValidate -linecomment -text"; DO NOT EDIT.
package nethelpers
import (
"fmt"
)
const _ARPValidateName = "noneactivebackupall"
var _ARPValidateIndex = [...]uint8{0, 4, 10, 16, 19}
func (i ARPValidate) String() string {
if i >= ARPValidate(len(_ARPValidateIndex)-1) {
return fmt.Sprintf("ARPValidate(%d)", i)
}
return _ARPValidateName[_ARPValidateIndex[i]:_ARPValidateIndex[i+1]]
}
var _ARPValidateValues = []ARPValidate{0, 1, 2, 3}
var _ARPValidateNameToValueMap = map[string]ARPValidate{
_ARPValidateName[0:4]: 0,
_ARPValidateName[4:10]: 1,
_ARPValidateName[10:16]: 2,
_ARPValidateName[16:19]: 3,
}
// ARPValidateString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func ARPValidateString(s string) (ARPValidate, error) {
if val, ok := _ARPValidateNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to ARPValidate values", s)
}
// ARPValidateValues returns all values of the enum
func ARPValidateValues() []ARPValidate {
return _ARPValidateValues
}
// IsAARPValidate returns "true" if the value is listed in the enum definition. "false" otherwise
func (i ARPValidate) IsAARPValidate() bool {
for _, v := range _ARPValidateValues {
if i == v {
return true
}
}
return false
}
// MarshalText implements the encoding.TextMarshaler interface for ARPValidate
func (i ARPValidate) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
// UnmarshalText implements the encoding.TextUnmarshaler interface for ARPValidate
func (i *ARPValidate) UnmarshalText(text []byte) error {
var err error
*i, err = ARPValidateString(string(text))
return err
}