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

package storage

import (
	"fmt"
	"strings"
)

const _LVMLogicalVolumeTypeName = "linearraid1raid0raid10"

var _LVMLogicalVolumeTypeIndex = [...]uint8{0, 6, 11, 16, 22}

const _LVMLogicalVolumeTypeLowerName = "linearraid1raid0raid10"

func (i LVMLogicalVolumeType) String() string {
	if i < 0 || i >= LVMLogicalVolumeType(len(_LVMLogicalVolumeTypeIndex)-1) {
		return fmt.Sprintf("LVMLogicalVolumeType(%d)", i)
	}
	return _LVMLogicalVolumeTypeName[_LVMLogicalVolumeTypeIndex[i]:_LVMLogicalVolumeTypeIndex[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 _LVMLogicalVolumeTypeNoOp() {
	var x [1]struct{}
	_ = x[LVMLogicalVolumeTypeLinear-(0)]
	_ = x[LVMLogicalVolumeTypeRAID1-(1)]
	_ = x[LVMLogicalVolumeTypeRAID0-(2)]
	_ = x[LVMLogicalVolumeTypeRAID10-(3)]
}

var _LVMLogicalVolumeTypeValues = []LVMLogicalVolumeType{LVMLogicalVolumeTypeLinear, LVMLogicalVolumeTypeRAID1, LVMLogicalVolumeTypeRAID0, LVMLogicalVolumeTypeRAID10}

var _LVMLogicalVolumeTypeNameToValueMap = map[string]LVMLogicalVolumeType{
	_LVMLogicalVolumeTypeName[0:6]:        LVMLogicalVolumeTypeLinear,
	_LVMLogicalVolumeTypeLowerName[0:6]:   LVMLogicalVolumeTypeLinear,
	_LVMLogicalVolumeTypeName[6:11]:       LVMLogicalVolumeTypeRAID1,
	_LVMLogicalVolumeTypeLowerName[6:11]:  LVMLogicalVolumeTypeRAID1,
	_LVMLogicalVolumeTypeName[11:16]:      LVMLogicalVolumeTypeRAID0,
	_LVMLogicalVolumeTypeLowerName[11:16]: LVMLogicalVolumeTypeRAID0,
	_LVMLogicalVolumeTypeName[16:22]:      LVMLogicalVolumeTypeRAID10,
	_LVMLogicalVolumeTypeLowerName[16:22]: LVMLogicalVolumeTypeRAID10,
}

var _LVMLogicalVolumeTypeNames = []string{
	_LVMLogicalVolumeTypeName[0:6],
	_LVMLogicalVolumeTypeName[6:11],
	_LVMLogicalVolumeTypeName[11:16],
	_LVMLogicalVolumeTypeName[16:22],
}

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

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

// LVMLogicalVolumeTypeValues returns all values of the enum
func LVMLogicalVolumeTypeValues() []LVMLogicalVolumeType {
	return _LVMLogicalVolumeTypeValues
}

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

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

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

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