Press n or j to go to the next uncovered block, b, p or k for the previous block.
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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | 1x 1x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 1x 1x 1x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 24x 24x 24x 24x 24x 24x 24x 107x 2x 2x 2x 2x 1x 1x 2x 107x 9x 9x 107x 201x 201x 201x 201x 201x 201x 201x 201x 201x 25x 201x 176x 176x 201x 201x 201x 201x 201x 201x 129x 129x 201x 201x 107x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 107x 9x 9x 9x 9x 107x 107x 253x 253x 253x 253x 253x 253x 253x 253x 253x 253x 253x 253x 253x 3x 253x 19x 253x 231x 231x 250x 250x 250x 250x 250x 253x 11x 253x 239x 239x 239x 239x 250x 250x 253x 107x 30x 30x 30x 30x 107x 1x 1x 1x 1x 1x 1x 1x 1x 107x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 8x 8x 8x 8x 6x 8x 1x 1x 1x 8x 2x 107x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_string_map.clas.abap class zcl_abapgit_string_map { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_STRING_MAP'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MT_ENTRIES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["K"]},"secondary":[]}, "zcl_abapgit_string_map=>ty_entries");}, "visibility": "U", "is_constant": " ", "is_class": " "}, "MV_READ_ONLY": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_IS_STRICT": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_CASE_INSENSITIVE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"CREATE": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}, "IV_CASE_INSENSITIVE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"IV_CASE_INSENSITIVE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "GET": {"visibility": "U", "parameters": {"RV_VAL": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_KEY": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "HAS": {"visibility": "U", "parameters": {"RV_HAS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_KEY": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "SET": {"visibility": "U", "parameters": {"RO_MAP": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}, "IV_KEY": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}}, "SIZE": {"visibility": "U", "parameters": {"RV_SIZE": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "IS_EMPTY": {"visibility": "U", "parameters": {"RV_YES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "DELETE": {"visibility": "U", "parameters": {"IV_KEY": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "CLEAR": {"visibility": "U", "parameters": {}}, "TO_ABAP": {"visibility": "U", "parameters": {"CS_CONTAINER": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}}}, "STRICT": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}, "IV_STRICT": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "FREEZE": {"visibility": "U", "parameters": {}}, "MERGE": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}, "IO_STRING_MAP": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}}}}; #mv_read_only; #mv_is_strict; #mv_case_insensitive; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "get": this.get.bind(this), "has": this.has.bind(this), "set": this.set.bind(this), "size": this.size.bind(this), "is_empty": this.is_empty.bind(this), "delete": this.delete.bind(this), "clear": this.clear.bind(this), "to_abap": this.to_abap.bind(this), "strict": this.strict.bind(this), "freeze": this.freeze.bind(this), "merge": this.merge.bind(this), }; this.mt_entries = abap.types.TableFactory.construct(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["K"]},"secondary":[]}, "zcl_abapgit_string_map=>ty_entries"); this.#mv_read_only = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_read_only"] = this.#mv_read_only; this.#mv_is_strict = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_is_strict"] = this.#mv_is_strict; this.#mv_case_insensitive = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_case_insensitive"] = this.#mv_case_insensitive; } async clear() { if (abap.compare.eq(this.#mv_read_only, abap.builtin.abap_true)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(42, 'Cannot clear. This string map is immutable')}); } this.mt_entries.clear(); } async constructor_(INPUT) { let iv_case_insensitive = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_case_insensitive) {iv_case_insensitive.set(INPUT.iv_case_insensitive);} if (INPUT === undefined || INPUT.iv_case_insensitive === undefined) {iv_case_insensitive = abap.builtin.abap_false;} this.#mv_is_strict.set(abap.builtin.abap_true); this.#mv_case_insensitive.set(iv_case_insensitive); return this; } async create(INPUT) { return zcl_abapgit_string_map.create(INPUT); } static async create(INPUT) { let ro_instance = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); let iv_case_insensitive = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_case_insensitive) {iv_case_insensitive.set(INPUT.iv_case_insensitive);} if (INPUT === undefined || INPUT.iv_case_insensitive === undefined) {iv_case_insensitive = abap.builtin.abap_false;} ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_MAP']()).constructor_({iv_case_insensitive: iv_case_insensitive})); return ro_instance; } async delete(INPUT) { let iv_key = INPUT?.iv_key; if (iv_key?.getQualifiedName === undefined || iv_key.getQualifiedName() !== "STRING") { iv_key = undefined; } if (iv_key === undefined) { iv_key = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_key); } if (abap.compare.eq(this.#mv_read_only, abap.builtin.abap_true)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(43, 'Cannot delete. This string map is immutable')}); } await abap.statements.deleteInternal(this.mt_entries,{where: async (I) => {return abap.compare.eq(I.k, iv_key);}}); } async freeze() { this.#mv_read_only.set(abap.builtin.abap_true); } async get(INPUT) { let rv_val = new abap.types.String({qualifiedName: "STRING"}); let iv_key = INPUT?.iv_key; if (iv_key?.getQualifiedName === undefined || iv_key.getQualifiedName() !== "STRING") { iv_key = undefined; } if (iv_key === undefined) { iv_key = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_key); } let lv_key = new abap.types.String({qualifiedName: "STRING"}); let fs_ls_entry_ = new abap.types.FieldSymbol(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {})); if (abap.compare.eq(this.#mv_case_insensitive, abap.builtin.abap_true)) { lv_key.set(abap.builtin.to_upper({val: iv_key})); } else { lv_key.set(iv_key); } abap.statements.readTable(this.mt_entries,{assigning: fs_ls_entry_, withKey: (i) => {return abap.compare.eq(i.k, lv_key);}, withKeyValue: [{key: (i) => {return i.k}, value: lv_key}], usesTableLine: false, withKeySimple: {"k": lv_key}}); if (abap.compare.initial(abap.builtin.sy.get().subrc)) { rv_val.set(fs_ls_entry_.get().v); } return rv_val; } async has(INPUT) { let rv_has = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let iv_key = INPUT?.iv_key; if (iv_key?.getQualifiedName === undefined || iv_key.getQualifiedName() !== "STRING") { iv_key = undefined; } if (iv_key === undefined) { iv_key = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_key); } abap.statements.readTable(this.mt_entries,{withKey: (i) => {return abap.compare.eq(i.k, iv_key);}, withKeyValue: [{key: (i) => {return i.k}, value: iv_key}], usesTableLine: false, withKeySimple: {"k": iv_key}}); rv_has.set(abap.builtin.boolc(abap.compare.initial(abap.builtin.sy.get().subrc))); return rv_has; } async is_empty() { let rv_yes = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); rv_yes.set(abap.builtin.boolc(abap.compare.eq(abap.builtin.lines({val: this.mt_entries}), abap.IntegerFactory.get(0)))); return rv_yes; } async merge(INPUT) { let ro_instance = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); let io_string_map = INPUT?.io_string_map; if (io_string_map?.getQualifiedName === undefined || io_string_map.getQualifiedName() !== "ZCL_ABAPGIT_STRING_MAP") { io_string_map = undefined; } if (io_string_map === undefined) { io_string_map = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}).set(INPUT.io_string_map); } let fs_ls_entry_ = new abap.types.FieldSymbol(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {})); for await (const unique1090 of abap.statements.loop(io_string_map.get().mt_entries)) { fs_ls_entry_.assign(unique1090); await this.set({iv_key: fs_ls_entry_.get().k, iv_val: fs_ls_entry_.get().v}); } ro_instance.set(this.me); return ro_instance; } async set(INPUT) { let ro_map = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); let iv_key = INPUT?.iv_key; if (iv_key?.getQualifiedName === undefined || iv_key.getQualifiedName() !== "STRING") { iv_key = undefined; } if (iv_key === undefined) { iv_key = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_key); } let iv_val = INPUT?.iv_val || new abap.types.Character(); let lv_key = new abap.types.String({qualifiedName: "STRING"}); let ls_entry = new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {}); let fs_ls_entry_ = new abap.types.FieldSymbol(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {})); if (abap.compare.eq(this.#mv_read_only, abap.builtin.abap_true)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(40, 'Cannot set. This string map is immutable')}); } if (abap.compare.eq(this.#mv_case_insensitive, abap.builtin.abap_true)) { lv_key.set(abap.builtin.to_upper({val: iv_key})); } else { lv_key.set(iv_key); } abap.statements.readTable(this.mt_entries,{assigning: fs_ls_entry_, withKey: (i) => {return abap.compare.eq(i.k, lv_key);}, withKeyValue: [{key: (i) => {return i.k}, value: lv_key}], usesTableLine: false, withKeySimple: {"k": lv_key}}); if (abap.compare.initial(abap.builtin.sy.get().subrc)) { fs_ls_entry_.get().v.set(iv_val); } else { ls_entry.get().k.set(lv_key); ls_entry.get().v.set(iv_val); abap.statements.insertInternal({data: ls_entry, table: this.mt_entries}); } ro_map.set(this.me); return ro_map; } async size() { let rv_size = new abap.types.Integer({qualifiedName: "I"}); rv_size.set(abap.builtin.lines({val: this.mt_entries})); return rv_size; } async strict(INPUT) { let ro_instance = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); let iv_strict = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_strict) {iv_strict.set(INPUT.iv_strict);} if (INPUT === undefined || INPUT.iv_strict === undefined) {iv_strict = abap.builtin.abap_true;} this.#mv_is_strict.set(iv_strict); ro_instance.set(this.me); return ro_instance; } async to_abap(INPUT) { let cs_container = new abap.types.Character(4); if (INPUT && INPUT.cs_container) {cs_container = INPUT.cs_container;} let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let lv_field = new abap.types.String({qualifiedName: "STRING"}); let fs_ls_entry_ = new abap.types.FieldSymbol(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {})); let fs_lv_val_ = new abap.types.FieldSymbol(new abap.types.Character(4)); lo_type.set((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: cs_container}))); if (abap.compare.ne(lo_type.get().type_kind, abap.Classes['CL_ABAP_TYPEDESCR'].typekind_struct1) && abap.compare.ne(lo_type.get().type_kind, abap.Classes['CL_ABAP_TYPEDESCR'].typekind_struct2)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(25, 'Only structures supported')}); } for await (const unique1091 of abap.statements.loop(this.mt_entries)) { fs_ls_entry_.assign(unique1091); lv_field.set(abap.builtin.to_upper({val: fs_ls_entry_.get().k})); abap.statements.assign({component: lv_field, target: fs_lv_val_, source: cs_container}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { fs_lv_val_.set(fs_ls_entry_.get().v); } else if (abap.compare.eq(this.#mv_is_strict, abap.builtin.abap_false)) { continue; } else { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Component ${abap.templateFormatting(lv_field)} not found in target`)}); } } } } abap.Classes['ZCL_ABAPGIT_STRING_MAP'] = zcl_abapgit_string_map; zcl_abapgit_string_map.ty_entry = new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {}); zcl_abapgit_string_map.ty_entries = abap.types.TableFactory.construct(new abap.types.Structure({ "k": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-K"}), "v": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_STRING_MAP=>TY_ENTRY-V"})}, "zcl_abapgit_string_map=>ty_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["K"]},"secondary":[]}, "zcl_abapgit_string_map=>ty_entries"); export {zcl_abapgit_string_map}; |