2018-10-12 22:10:49 +02:00
|
|
|
// Code generated by "enumer -type=State"; DO NOT EDIT.
|
|
|
|
|
|
|
|
package pruner
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-03-13 20:50:03 +01:00
|
|
|
_StateName_0 = "PlanPlanErr"
|
2018-10-12 22:10:49 +02:00
|
|
|
_StateName_1 = "Exec"
|
2019-03-13 20:50:03 +01:00
|
|
|
_StateName_2 = "ExecErr"
|
|
|
|
_StateName_3 = "Done"
|
2018-10-12 22:10:49 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-03-13 20:50:03 +01:00
|
|
|
_StateIndex_0 = [...]uint8{0, 4, 11}
|
2018-10-12 22:10:49 +02:00
|
|
|
_StateIndex_1 = [...]uint8{0, 4}
|
2019-03-13 20:50:03 +01:00
|
|
|
_StateIndex_2 = [...]uint8{0, 7}
|
|
|
|
_StateIndex_3 = [...]uint8{0, 4}
|
2018-10-12 22:10:49 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func (i State) String() string {
|
|
|
|
switch {
|
|
|
|
case 1 <= i && i <= 2:
|
|
|
|
i -= 1
|
|
|
|
return _StateName_0[_StateIndex_0[i]:_StateIndex_0[i+1]]
|
|
|
|
case i == 4:
|
|
|
|
return _StateName_1
|
|
|
|
case i == 8:
|
|
|
|
return _StateName_2
|
|
|
|
case i == 16:
|
|
|
|
return _StateName_3
|
|
|
|
default:
|
|
|
|
return fmt.Sprintf("State(%d)", i)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-13 20:50:03 +01:00
|
|
|
var _StateValues = []State{1, 2, 4, 8, 16}
|
2018-10-12 22:10:49 +02:00
|
|
|
|
|
|
|
var _StateNameToValueMap = map[string]State{
|
|
|
|
_StateName_0[0:4]: 1,
|
2019-03-13 20:50:03 +01:00
|
|
|
_StateName_0[4:11]: 2,
|
2018-10-12 22:10:49 +02:00
|
|
|
_StateName_1[0:4]: 4,
|
2019-03-13 20:50:03 +01:00
|
|
|
_StateName_2[0:7]: 8,
|
|
|
|
_StateName_3[0:4]: 16,
|
2018-10-12 22:10:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// StateString retrieves an enum value from the enum constants string name.
|
|
|
|
// Throws an error if the param is not part of the enum.
|
|
|
|
func StateString(s string) (State, error) {
|
|
|
|
if val, ok := _StateNameToValueMap[s]; ok {
|
|
|
|
return val, nil
|
|
|
|
}
|
|
|
|
return 0, fmt.Errorf("%s does not belong to State values", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
// StateValues returns all values of the enum
|
|
|
|
func StateValues() []State {
|
|
|
|
return _StateValues
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsAState returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
|
|
func (i State) IsAState() bool {
|
|
|
|
for _, v := range _StateValues {
|
|
|
|
if i == v {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|