-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum_previousfee.go
92 lines (76 loc) · 2.1 KB
/
enum_previousfee.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Code generated by "enumerator -type PreviousFee -empty"; DO NOT EDIT.
package pay
import (
"fmt"
"strconv"
)
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[PreviousFeeFull-1]
_ = x[PreviousFeeHalf-2]
_ = x[PreviousFeeExemption-3]
_ = x[PreviousFeeHardship-4]
}
const _PreviousFee_name = "FullHalfExemptionHardship"
var _PreviousFee_index = [...]uint8{0, 4, 8, 17, 25}
func (i PreviousFee) String() string {
i -= 1
if i >= PreviousFee(len(_PreviousFee_index)-1) {
return "PreviousFee(" + strconv.FormatInt(int64(i+1), 10) + ")"
}
return _PreviousFee_name[_PreviousFee_index[i]:_PreviousFee_index[i+1]]
}
func (i PreviousFee) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
func (i *PreviousFee) UnmarshalText(text []byte) error {
val, err := ParsePreviousFee(string(text))
if err != nil {
return err
}
*i = val
return nil
}
func (i PreviousFee) IsPreviousFeeFull() bool {
return i == PreviousFeeFull
}
func (i PreviousFee) IsPreviousFeeHalf() bool {
return i == PreviousFeeHalf
}
func (i PreviousFee) IsPreviousFeeExemption() bool {
return i == PreviousFeeExemption
}
func (i PreviousFee) IsPreviousFeeHardship() bool {
return i == PreviousFeeHardship
}
func ParsePreviousFee(s string) (PreviousFee, error) {
switch s {
case "Full":
return PreviousFeeFull, nil
case "Half":
return PreviousFeeHalf, nil
case "Exemption":
return PreviousFeeExemption, nil
case "Hardship":
return PreviousFeeHardship, nil
default:
return PreviousFee(0), fmt.Errorf("invalid PreviousFee '%s'", s)
}
}
type PreviousFeeOptions struct {
PreviousFeeFull PreviousFee
PreviousFeeHalf PreviousFee
PreviousFeeExemption PreviousFee
PreviousFeeHardship PreviousFee
}
var PreviousFeeValues = PreviousFeeOptions{
PreviousFeeFull: PreviousFeeFull,
PreviousFeeHalf: PreviousFeeHalf,
PreviousFeeExemption: PreviousFeeExemption,
PreviousFeeHardship: PreviousFeeHardship,
}
func (i PreviousFee) Empty() bool {
return i == PreviousFee(0)
}