Debian Codegraph @

sarif/properties.go

raw symbols SCIP
1 package sarif
2
3 // Properties ...
4 type Properties map[string]interface{}
5
6 // PropertyBag ...
7 type PropertyBag struct {
8 Properties Properties `json:"properties,omitempty"`
9 }
10
11 // NewPropertyBag ...
12 func NewPropertyBag() *PropertyBag {
13 return &PropertyBag{
14 Properties: Properties{},
15 }
16 }
17
18 // Add ...
19 func (pb *PropertyBag) Add(key string, value interface{}) {
20 pb.Properties[key] = value
21 }
22
23 // AddString ...
24 func (pb *PropertyBag) AddString(key, value string) {
25 pb.Add(key, value)
26 }
27
28 // AddBoolean ...
29 func (pb *PropertyBag) AddBoolean(key string, value bool) {
30 pb.Add(key, value)
31 }
32
33 // AddInteger ...
34 func (pb *PropertyBag) AddInteger(key string, value int) {
35 pb.Add(key, value)
36 }