gitlab.com/evatix-go/core@v1.3.55/coredata/corepayload/payloadProperties.go (about) 1 package corepayload 2 3 import ( 4 "gitlab.com/evatix-go/core/coredata/coredynamic" 5 "gitlab.com/evatix-go/core/coredata/corejson" 6 "gitlab.com/evatix-go/core/coreinterface/errcoreinf" 7 "gitlab.com/evatix-go/core/coreinterface/payloadinf" 8 ) 9 10 type payloadProperties struct { 11 payloadWrapper *PayloadWrapper 12 } 13 14 func (it *payloadProperties) SetBasicError(basicError errcoreinf.BasicErrWrapper) { 15 it.payloadWrapper.InitializeAttributesOnNull() 16 it.payloadWrapper.Attributes.SetBasicErr(basicError) 17 } 18 19 func (it *payloadProperties) BasicError() errcoreinf.BasicErrWrapper { 20 return it.payloadWrapper.BasicError() 21 } 22 23 func (it *payloadProperties) ReflectSetTo(toPointer interface{}) error { 24 return coredynamic.ReflectSetFromTo(it.payloadWrapper, toPointer) 25 } 26 27 func (it payloadProperties) AllSafe() (id, name, entity, category string, dynamicPayloads []byte) { 28 return it.payloadWrapper.AllSafe() 29 } 30 31 func (it payloadProperties) All() (id, name, entity, category string, dynamicPayloads []byte) { 32 return it.payloadWrapper.All() 33 } 34 35 func (it payloadProperties) Name() string { 36 return it.payloadWrapper.Name 37 } 38 39 func (it *payloadProperties) SetName(name string) error { 40 it.payloadWrapper.Name = name 41 42 return nil 43 } 44 45 func (it *payloadProperties) SetNameMust(name string) { 46 it.payloadWrapper.Name = name 47 } 48 49 func (it *payloadProperties) IdInteger() int { 50 return it.payloadWrapper.IdInteger() 51 } 52 53 func (it *payloadProperties) IdUnsignedInteger() uint { 54 return it.payloadWrapper.IdentifierUnsignedInteger() 55 } 56 57 func (it payloadProperties) IdString() string { 58 return it.payloadWrapper.Identifier 59 } 60 61 func (it *payloadProperties) SetIdString(id string) error { 62 it.payloadWrapper.Identifier = id 63 64 return nil 65 } 66 67 func (it *payloadProperties) SetIdStringMust(id string) { 68 it.payloadWrapper.Identifier = id 69 } 70 71 func (it payloadProperties) Category() string { 72 return it.payloadWrapper.CategoryName 73 } 74 75 func (it *payloadProperties) SetCategory(category string) error { 76 it.payloadWrapper.CategoryName = category 77 78 return nil 79 } 80 81 func (it *payloadProperties) SetCategoryMust(category string) { 82 it.payloadWrapper.CategoryName = category 83 } 84 85 func (it payloadProperties) EntityType() string { 86 return it.payloadWrapper.EntityType 87 } 88 89 func (it *payloadProperties) SetEntityType(entityName string) error { 90 it.payloadWrapper.EntityType = entityName 91 92 return nil 93 } 94 95 func (it *payloadProperties) SetEntityTypeMust(entityName string) { 96 it.payloadWrapper.EntityType = entityName 97 } 98 99 func (it *payloadProperties) HasManyRecord() bool { 100 return it.payloadWrapper.HasManyRecords 101 } 102 103 func (it payloadProperties) HasSingleRecordOnly() bool { 104 return !it.HasManyRecord() 105 } 106 107 func (it *payloadProperties) SetSingleRecordFlag() { 108 it.payloadWrapper.HasManyRecords = false 109 } 110 111 func (it *payloadProperties) SetManyRecordFlag() { 112 it.payloadWrapper.HasManyRecords = true 113 } 114 115 func (it payloadProperties) DynamicPayloads() []byte { 116 return it.payloadWrapper.Payloads 117 } 118 119 func (it *payloadProperties) SetDynamicPayloads(dynamicPayloads []byte) error { 120 it.payloadWrapper.Payloads = dynamicPayloads 121 122 return nil 123 } 124 125 func (it *payloadProperties) DynamicPayloadsDeserializedTo(toPtr interface{}) error { 126 return it.payloadWrapper.Deserialize(toPtr) 127 } 128 129 func (it *payloadProperties) SetDynamicPayloadsMust(dynamicPayloads []byte) { 130 it.payloadWrapper.Payloads = dynamicPayloads 131 } 132 133 func (it payloadProperties) Json() corejson.Result { 134 return it.payloadWrapper.Json() 135 } 136 137 func (it payloadProperties) JsonPtr() *corejson.Result { 138 return it.payloadWrapper.JsonPtr() 139 } 140 141 func (it payloadProperties) AsPayloadPropertiesDefiner() payloadinf.PayloadPropertiesDefiner { 142 return &it 143 }