// Code generated by "enumer -type=ExplainFormat -trimprefix=ExplainFormat -transform=snake_upper"; DO NOT EDIT.

package enums

import (
	"fmt"
	"strings"
)

const _ExplainFormatName = "UNSPECIFIEDCURRENTTRADITIONALCOMPACT"

var _ExplainFormatIndex = [...]uint8{0, 11, 18, 29, 36}

const _ExplainFormatLowerName = "unspecifiedcurrenttraditionalcompact"

func (i ExplainFormat) String() string {
	if i < 0 || i >= ExplainFormat(len(_ExplainFormatIndex)-1) {
		return fmt.Sprintf("ExplainFormat(%d)", i)
	}
	return _ExplainFormatName[_ExplainFormatIndex[i]:_ExplainFormatIndex[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 _ExplainFormatNoOp() {
	var x [1]struct{}
	_ = x[ExplainFormatUnspecified-(0)]
	_ = x[ExplainFormatCurrent-(1)]
	_ = x[ExplainFormatTraditional-(2)]
	_ = x[ExplainFormatCompact-(3)]
}

var _ExplainFormatValues = []ExplainFormat{ExplainFormatUnspecified, ExplainFormatCurrent, ExplainFormatTraditional, ExplainFormatCompact}

var _ExplainFormatNameToValueMap = map[string]ExplainFormat{
	_ExplainFormatName[0:11]:       ExplainFormatUnspecified,
	_ExplainFormatLowerName[0:11]:  ExplainFormatUnspecified,
	_ExplainFormatName[11:18]:      ExplainFormatCurrent,
	_ExplainFormatLowerName[11:18]: ExplainFormatCurrent,
	_ExplainFormatName[18:29]:      ExplainFormatTraditional,
	_ExplainFormatLowerName[18:29]: ExplainFormatTraditional,
	_ExplainFormatName[29:36]:      ExplainFormatCompact,
	_ExplainFormatLowerName[29:36]: ExplainFormatCompact,
}

var _ExplainFormatNames = []string{
	_ExplainFormatName[0:11],
	_ExplainFormatName[11:18],
	_ExplainFormatName[18:29],
	_ExplainFormatName[29:36],
}

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

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

// ExplainFormatValues returns all values of the enum
func ExplainFormatValues() []ExplainFormat {
	return _ExplainFormatValues
}

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

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