// Code generated by "enumer -type=BondXmitHashPolicy -linecomment -text"; DO NOT EDIT.

package nethelpers

import (
	"fmt"
)

const _BondXmitHashPolicyName = "layer2layer3+4layer2+3encap2+3encap3+4"

var _BondXmitHashPolicyIndex = [...]uint8{0, 6, 14, 22, 30, 38}

func (i BondXmitHashPolicy) String() string {
	if i >= BondXmitHashPolicy(len(_BondXmitHashPolicyIndex)-1) {
		return fmt.Sprintf("BondXmitHashPolicy(%d)", i)
	}
	return _BondXmitHashPolicyName[_BondXmitHashPolicyIndex[i]:_BondXmitHashPolicyIndex[i+1]]
}

var _BondXmitHashPolicyValues = []BondXmitHashPolicy{0, 1, 2, 3, 4}

var _BondXmitHashPolicyNameToValueMap = map[string]BondXmitHashPolicy{
	_BondXmitHashPolicyName[0:6]:   0,
	_BondXmitHashPolicyName[6:14]:  1,
	_BondXmitHashPolicyName[14:22]: 2,
	_BondXmitHashPolicyName[22:30]: 3,
	_BondXmitHashPolicyName[30:38]: 4,
}

// BondXmitHashPolicyString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func BondXmitHashPolicyString(s string) (BondXmitHashPolicy, error) {
	if val, ok := _BondXmitHashPolicyNameToValueMap[s]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to BondXmitHashPolicy values", s)
}

// BondXmitHashPolicyValues returns all values of the enum
func BondXmitHashPolicyValues() []BondXmitHashPolicy {
	return _BondXmitHashPolicyValues
}

// IsABondXmitHashPolicy returns "true" if the value is listed in the enum definition. "false" otherwise
func (i BondXmitHashPolicy) IsABondXmitHashPolicy() bool {
	for _, v := range _BondXmitHashPolicyValues {
		if i == v {
			return true
		}
	}
	return false
}

// MarshalText implements the encoding.TextMarshaler interface for BondXmitHashPolicy
func (i BondXmitHashPolicy) MarshalText() ([]byte, error) {
	return []byte(i.String()), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface for BondXmitHashPolicy
func (i *BondXmitHashPolicy) UnmarshalText(text []byte) error {
	var err error
	*i, err = BondXmitHashPolicyString(string(text))
	return err
}
