// Code generated by "enumer -type=Enum"; DO NOT EDIT.

package main

import (
	"fmt"
	"strings"
)

const _EnumName = "ZeroOneTwoThree"

var _EnumIndex = [...]uint8{0, 4, 7, 10, 15}

const _EnumLowerName = "zeroonetwothree"

func (i Enum) String() string {
	if i >= Enum(len(_EnumIndex)-1) {
		return fmt.Sprintf("Enum(%d)", i)
	}
	return _EnumName[_EnumIndex[i]:_EnumIndex[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 _EnumNoOp() {
	var x [1]struct{}
	_ = x[Zero-(0)]
	_ = x[One-(1)]
	_ = x[Two-(2)]
	_ = x[Three-(3)]
}

var _EnumValues = []Enum{Zero, One, Two, Three}

var _EnumNameToValueMap = map[string]Enum{
	_EnumName[0:4]:        Zero,
	_EnumLowerName[0:4]:   Zero,
	_EnumName[4:7]:        One,
	_EnumLowerName[4:7]:   One,
	_EnumName[7:10]:       Two,
	_EnumLowerName[7:10]:  Two,
	_EnumName[10:15]:      Three,
	_EnumLowerName[10:15]: Three,
}

var _EnumNames = []string{
	_EnumName[0:4],
	_EnumName[4:7],
	_EnumName[7:10],
	_EnumName[10:15],
}

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

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

// EnumValues returns all values of the enum
func EnumValues() []Enum {
	return _EnumValues
}

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

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