Debian Codegraph @

v2/sarif/address.go

raw
1 package sarif
2
3 // Address ...
4 type Address struct {
5 Index *uint `json:"index,omitempty"`
6 AbsoluteAddress *uint `json:"absoluteAddress,omitempty"`
7 RelativeAddress *int `json:"relativeAddress,omitempty"`
8 OffsetFromParent *int `json:"offsetFromParent,omitempty"`
9 Length *int `json:"length,omitempty"`
10 Name *string `json:"name,omitempty"`
11 FullyQualifiedName *string `json:"fullyQualifiedName,omitempty"`
12 Kind *string `json:"kind,omitempty"`
13 ParentIndex *uint `json:"parentIndex,omitempty"`
14 PropertyBag
15 }
16
17 // NewAddress create a new Address and returns a pointer to it
18 func NewAddress() *Address {
19 return &Address{}
20 }
21
22 // WithIndex sets the Index
23 func (address *Address) WithIndex(index int) *Address {
24 i := uint(index)
25 address.Index = &i
26 return address
27 }
28
29 // WithAbsoluteAddress sets the AbsoluteAddress
30 func (address *Address) WithAbsoluteAddress(absoluteAddress int) *Address {
31 i := uint(absoluteAddress)
32 address.AbsoluteAddress = &i
33 return address
34 }
35
36 // WithRelativeAddress sets the RelativeAddress
37 func (address *Address) WithRelativeAddress(relativeAddress int) *Address {
38 address.RelativeAddress = &relativeAddress
39 return address
40 }
41
42 // WithOffsetFromParent sets the OffsetFromParent
43 func (address *Address) WithOffsetFromParent(offsetFromParent int) *Address {
44 address.OffsetFromParent = &offsetFromParent
45 return address
46 }
47
48 // WithLength sets the Length
49 func (address *Address) WithLength(length int) *Address {
50 address.Length = &length
51 return address
52 }
53
54 // WithName sets the Name
55 func (address *Address) WithName(name string) *Address {
56 address.Name = &name
57 return address
58 }
59
60 // WithFullyQualifiedName sets the FullyQualifiedName
61 func (address *Address) WithFullyQualifiedName(fullyQualifiedName string) *Address {
62 address.FullyQualifiedName = &fullyQualifiedName
63 return address
64 }
65
66 // WithKind sets the Kind
67 func (address *Address) WithKind(kind string) *Address {
68 address.Kind = &kind
69 return address
70 }
71
72 // WithParentIndex sets the ParentIndex
73 func (address *Address) WithParentIndex(parentIndex int) *Address {
74 i := uint(parentIndex)
75 address.ParentIndex = &i
76 return address
77 }