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

package enums

import (
	"fmt"
	"strings"
)

const _DisplayModeName = "UNSPECIFIEDTABLETABLE_COMMENTTABLE_DETAIL_COMMENTVERTICALTABHTMLXMLCSVSQL_INSERTSQL_INSERT_OR_IGNORESQL_INSERT_OR_UPDATE"

var _DisplayModeIndex = [...]uint8{0, 11, 16, 29, 49, 57, 60, 64, 67, 70, 80, 100, 120}

const _DisplayModeLowerName = "unspecifiedtabletable_commenttable_detail_commentverticaltabhtmlxmlcsvsql_insertsql_insert_or_ignoresql_insert_or_update"

func (i DisplayMode) String() string {
	if i < 0 || i >= DisplayMode(len(_DisplayModeIndex)-1) {
		return fmt.Sprintf("DisplayMode(%d)", i)
	}
	return _DisplayModeName[_DisplayModeIndex[i]:_DisplayModeIndex[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 _DisplayModeNoOp() {
	var x [1]struct{}
	_ = x[DisplayModeUnspecified-(0)]
	_ = x[DisplayModeTable-(1)]
	_ = x[DisplayModeTableComment-(2)]
	_ = x[DisplayModeTableDetailComment-(3)]
	_ = x[DisplayModeVertical-(4)]
	_ = x[DisplayModeTab-(5)]
	_ = x[DisplayModeHTML-(6)]
	_ = x[DisplayModeXML-(7)]
	_ = x[DisplayModeCSV-(8)]
	_ = x[DisplayModeSQLInsert-(9)]
	_ = x[DisplayModeSQLInsertOrIgnore-(10)]
	_ = x[DisplayModeSQLInsertOrUpdate-(11)]
}

var _DisplayModeValues = []DisplayMode{DisplayModeUnspecified, DisplayModeTable, DisplayModeTableComment, DisplayModeTableDetailComment, DisplayModeVertical, DisplayModeTab, DisplayModeHTML, DisplayModeXML, DisplayModeCSV, DisplayModeSQLInsert, DisplayModeSQLInsertOrIgnore, DisplayModeSQLInsertOrUpdate}

var _DisplayModeNameToValueMap = map[string]DisplayMode{
	_DisplayModeName[0:11]:         DisplayModeUnspecified,
	_DisplayModeLowerName[0:11]:    DisplayModeUnspecified,
	_DisplayModeName[11:16]:        DisplayModeTable,
	_DisplayModeLowerName[11:16]:   DisplayModeTable,
	_DisplayModeName[16:29]:        DisplayModeTableComment,
	_DisplayModeLowerName[16:29]:   DisplayModeTableComment,
	_DisplayModeName[29:49]:        DisplayModeTableDetailComment,
	_DisplayModeLowerName[29:49]:   DisplayModeTableDetailComment,
	_DisplayModeName[49:57]:        DisplayModeVertical,
	_DisplayModeLowerName[49:57]:   DisplayModeVertical,
	_DisplayModeName[57:60]:        DisplayModeTab,
	_DisplayModeLowerName[57:60]:   DisplayModeTab,
	_DisplayModeName[60:64]:        DisplayModeHTML,
	_DisplayModeLowerName[60:64]:   DisplayModeHTML,
	_DisplayModeName[64:67]:        DisplayModeXML,
	_DisplayModeLowerName[64:67]:   DisplayModeXML,
	_DisplayModeName[67:70]:        DisplayModeCSV,
	_DisplayModeLowerName[67:70]:   DisplayModeCSV,
	_DisplayModeName[70:80]:        DisplayModeSQLInsert,
	_DisplayModeLowerName[70:80]:   DisplayModeSQLInsert,
	_DisplayModeName[80:100]:       DisplayModeSQLInsertOrIgnore,
	_DisplayModeLowerName[80:100]:  DisplayModeSQLInsertOrIgnore,
	_DisplayModeName[100:120]:      DisplayModeSQLInsertOrUpdate,
	_DisplayModeLowerName[100:120]: DisplayModeSQLInsertOrUpdate,
}

var _DisplayModeNames = []string{
	_DisplayModeName[0:11],
	_DisplayModeName[11:16],
	_DisplayModeName[16:29],
	_DisplayModeName[29:49],
	_DisplayModeName[49:57],
	_DisplayModeName[57:60],
	_DisplayModeName[60:64],
	_DisplayModeName[64:67],
	_DisplayModeName[67:70],
	_DisplayModeName[70:80],
	_DisplayModeName[80:100],
	_DisplayModeName[100:120],
}

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

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

// DisplayModeValues returns all values of the enum
func DisplayModeValues() []DisplayMode {
	return _DisplayModeValues
}

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

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