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

package nethelpers

import (
	"fmt"
)

const _PrimaryReselectName = "alwaysbetterfailure"

var _PrimaryReselectIndex = [...]uint8{0, 6, 12, 19}

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

var _PrimaryReselectValues = []PrimaryReselect{0, 1, 2}

var _PrimaryReselectNameToValueMap = map[string]PrimaryReselect{
	_PrimaryReselectName[0:6]:   0,
	_PrimaryReselectName[6:12]:  1,
	_PrimaryReselectName[12:19]: 2,
}

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

// PrimaryReselectValues returns all values of the enum
func PrimaryReselectValues() []PrimaryReselect {
	return _PrimaryReselectValues
}

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

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

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