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