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

package runtime

import (
	"fmt"
	"strings"
)

const _FIPSStateName = "disabledenabledenabled, strict"

var _FIPSStateIndex = [...]uint8{0, 8, 15, 30}

const _FIPSStateLowerName = "disabledenabledenabled, strict"

func (i FIPSState) String() string {
	if i < 0 || i >= FIPSState(len(_FIPSStateIndex)-1) {
		return fmt.Sprintf("FIPSState(%d)", i)
	}
	return _FIPSStateName[_FIPSStateIndex[i]:_FIPSStateIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _FIPSStateNoOp() {
	var x [1]struct{}
	_ = x[FIPSStateDisabled-(0)]
	_ = x[FIPSStateEnabled-(1)]
	_ = x[FIPSStateStrict-(2)]
}

var _FIPSStateValues = []FIPSState{FIPSStateDisabled, FIPSStateEnabled, FIPSStateStrict}

var _FIPSStateNameToValueMap = map[string]FIPSState{
	_FIPSStateName[0:8]:        FIPSStateDisabled,
	_FIPSStateLowerName[0:8]:   FIPSStateDisabled,
	_FIPSStateName[8:15]:       FIPSStateEnabled,
	_FIPSStateLowerName[8:15]:  FIPSStateEnabled,
	_FIPSStateName[15:30]:      FIPSStateStrict,
	_FIPSStateLowerName[15:30]: FIPSStateStrict,
}

var _FIPSStateNames = []string{
	_FIPSStateName[0:8],
	_FIPSStateName[8:15],
	_FIPSStateName[15:30],
}

// FIPSStateString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func FIPSStateString(s string) (FIPSState, error) {
	if val, ok := _FIPSStateNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _FIPSStateNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to FIPSState values", s)
}

// FIPSStateValues returns all values of the enum
func FIPSStateValues() []FIPSState {
	return _FIPSStateValues
}

// FIPSStateStrings returns a slice of all String values of the enum
func FIPSStateStrings() []string {
	strs := make([]string, len(_FIPSStateNames))
	copy(strs, _FIPSStateNames)
	return strs
}

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

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

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