-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum_correspondentshare.go
81 lines (68 loc) · 2.01 KB
/
enum_correspondentshare.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
// Code generated by "enumerator -type CorrespondentShare -linecomment -trimprefix -empty -bits"; DO NOT EDIT.
package actor
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[CorrespondentShareAttorneys-2]
_ = x[CorrespondentShareCertificateProvider-4]
}
const (
_CorrespondentShare_name_0 = "Attorneys"
_CorrespondentShare_name_1 = "CertificateProvider"
)
func (i CorrespondentShare) String() string {
switch {
case i == 2:
return _CorrespondentShare_name_0
case i == 4:
return _CorrespondentShare_name_1
default:
return "CorrespondentShare(" + strconv.FormatInt(int64(i), 10) + ")"
}
}
func (i CorrespondentShare) Strings() []string {
var result []string
if i.HasAttorneys() {
result = append(result, CorrespondentShareAttorneys.String())
}
if i.HasCertificateProvider() {
result = append(result, CorrespondentShareCertificateProvider.String())
}
return result
}
func (i CorrespondentShare) HasAttorneys() bool {
return i&CorrespondentShareAttorneys != 0
}
func (i CorrespondentShare) HasCertificateProvider() bool {
return i&CorrespondentShareCertificateProvider != 0
}
func ParseCorrespondentShare(strs []string) (CorrespondentShare, error) {
var result CorrespondentShare
for _, s := range strs {
switch s {
case "Attorneys":
result |= CorrespondentShareAttorneys
case "CertificateProvider":
result |= CorrespondentShareCertificateProvider
default:
return CorrespondentShare(0), fmt.Errorf("invalid CorrespondentShare '%s'", s)
}
}
return result, nil
}
type CorrespondentShareOptions struct {
Attorneys CorrespondentShare
CertificateProvider CorrespondentShare
}
var CorrespondentShareValues = CorrespondentShareOptions{
Attorneys: CorrespondentShareAttorneys,
CertificateProvider: CorrespondentShareCertificateProvider,
}
func (i CorrespondentShare) Empty() bool {
return i == CorrespondentShare(0)
}