// 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 }