{"id":181,"date":"2025-08-18T13:04:57","date_gmt":"2025-08-18T13:04:57","guid":{"rendered":"https:\/\/iotnoob.com\/wordpress\/?p=181"},"modified":"2025-08-18T13:16:41","modified_gmt":"2025-08-18T13:16:41","slug":"%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99-one-liner-%e0%b9%80%e0%b8%9e%e0%b8%b7%e0%b9%88%e0%b8%ad%e0%b8%81%e0%b8%b2%e0%b8%a3-set-%e0%b8%84%e0%b9%88%e0%b8%b2","status":"publish","type":"post","link":"https:\/\/iotnoob.com\/wordpress\/2025\/08\/18\/%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99-one-liner-%e0%b9%80%e0%b8%9e%e0%b8%b7%e0%b9%88%e0%b8%ad%e0%b8%81%e0%b8%b2%e0%b8%a3-set-%e0%b8%84%e0%b9%88%e0%b8%b2\/","title":{"rendered":"\u0e40\u0e02\u0e35\u0e22\u0e19 one-liner \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e01\u0e32\u0e23 set \u0e04\u0e48\u0e32"},"content":{"rendered":"\n<p>\u0e40\u0e02\u0e35\u0e22\u0e19\u0e41\u0e25\u0e49\u0e27\u0e14\u0e39\u0e2d\u0e48\u0e32\u0e19\u0e22\u0e32\u0e01 \u0e41\u0e15\u0e48\u0e01\u0e47\u0e14\u0e39\u0e40\u0e1b\u0e47\u0e19\u0e02\u0e31\u0e49\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e2d\u0e19\u0e14\u0e35 code \u0e14\u0e39\u0e2a\u0e27\u0e22 \u0e41\u0e15\u0e48\u0e2d\u0e48\u0e32\u0e19\u0e22\u0e32\u0e01\u0e08\u0e31\u0e07<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Layer.setLayerId(\n    Optional.ofNullable(getCellValueAsString(sheet, i, 1)) \/\/ 1. \u0e2b\u0e48\u0e2d\u0e04\u0e48\u0e32\u0e14\u0e49\u0e27\u0e22 Optional (\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19 null)\n            .filter(s -> s.matches(\"[0-9]+\"))              \/\/ 2. \u0e01\u0e23\u0e2d\u0e07\u0e40\u0e2d\u0e32\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e04\u0e48\u0e32\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e31\u0e27\u0e40\u0e25\u0e02\n            .map(Integer::parseInt)                           \/\/ 3. \u0e16\u0e49\u0e32\u0e1c\u0e48\u0e32\u0e19\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02 \u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19 Integer\n            .orElse(0)                                        \/\/ 4. \u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e1c\u0e48\u0e32\u0e19\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02\u0e43\u0e14\u0e46 \u0e40\u0e25\u0e22 \u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e04\u0e48\u0e32 0\n);<\/pre>\n\n\n\n<p>\u0e40\u0e19\u0e37\u0e48\u0e2d\u0e07\u0e08\u0e32\u0e01\u0e40\u0e23\u0e32\u0e44\u0e21\u0e48\u0e2d\u0e22\u0e32\u0e01 \u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19 code \u0e43\u0e19\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e02\u0e49\u0e32\u0e07\u0e25\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 (\u0e16\u0e49\u0e32\u0e21\u0e35\u0e04\u0e48\u0e32\u0e40\u0e14\u0e35\u0e22\u0e27\u0e01\u0e47\u0e42\u0e2d\u0e40\u0e04 \u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e2b\u0e25\u0e32\u0e22\u0e04\u0e48\u0e32\u0e01\u0e47\u0e41\u0e22\u0e48\u0e2b\u0e19\u0e48\u0e2d\u0e22)<\/p>\n\n\n\n<p>\u0e41\u0e15\u0e48\u0e21\u0e31\u0e19\u0e01\u0e47\u0e15\u0e23\u0e07\u0e44\u0e1b\u0e15\u0e23\u0e07\u0e21\u0e32\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14\u0e41\u0e25\u0e49\u0e27<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ 1. \u0e14\u0e36\u0e07\u0e04\u0e48\u0e32\u0e08\u0e32\u0e01\u0e40\u0e0b\u0e25\u0e25\u0e4c\u0e21\u0e32\u0e40\u0e01\u0e47\u0e1a\u0e43\u0e19\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e01\u0e48\u0e2d\u0e19\nString value = getCellValueAsString(sheet, i, 1);\n\n\/\/ 2. \u0e43\u0e0a\u0e49 ternary operator \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e41\u0e1b\u0e25\u0e07\u0e04\u0e48\u0e32\n\/\/ \u0e16\u0e49\u0e32 value \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e31\u0e27\u0e40\u0e25\u0e02 \u0e01\u0e47\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19 Integer, \u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48 \u0e01\u0e47\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19 0\nint layerId = (value != null &amp;&amp; value.matches(\"[0-9]+\")) ? Integer.parseInt(value) : 0;\n\n\/\/ 3. \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e48\u0e32 ID\nLayer.setLayerId(layerId);<\/pre>\n\n\n\n<p>\u0e40\u0e02\u0e35\u0e22\u0e19\u0e41\u0e1a\u0e1a\u0e02\u0e49\u0e32\u0e07\u0e25\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e19\u0e48\u0e32\u0e08\u0e30\u0e07\u0e48\u0e32\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14 \u0e41\u0e15\u0e48\u0e14\u0e31\u0e19\u0e44\u0e1b\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 function 2 \u0e23\u0e2d\u0e1a \u0e16\u0e49\u0e32 function \u0e0b\u0e31\u0e1a\u0e0b\u0e49\u0e2d\u0e19 \u0e21\u0e31\u0e19\u0e01\u0e47\u0e40\u0e2a\u0e35\u0e22\u0e40\u0e27\u0e25\u0e32 \u0e01\u0e47\u0e14\u0e39\u0e41\u0e22\u0e48\u0e44\u0e1b\u0e2b\u0e19\u0e48\u0e2d\u0e22<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u26a0\ufe0f \u0e44\u0e21\u0e48\u0e41\u0e19\u0e30\u0e19\u0e33: \u0e40\u0e23\u0e35\u0e22\u0e01\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e0b\u0e49\u0e33\u0e0b\u0e49\u0e2d\u0e19\nLayer.setLayerId(\n    getCellValueAsString(sheet, i, 1).matches(\"[0-9]+\") ? Integer.parseInt(getCellValueAsString(sheet, i, 1)) : 0\n);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0e40\u0e02\u0e35\u0e22\u0e19\u0e41\u0e25\u0e49\u0e27\u0e14\u0e39\u0e2d\u0e48\u0e32\u0e19\u0e22\u0e32\u0e01 \u0e41\u0e15\u0e48\u0e01\u0e47\u0e14\u0e39\u0e40\u0e1b\u0e47\u0e19\u0e02\u0e31\u0e49\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e2d\u0e19\u0e14\u0e35 code \u0e14\u0e39\u0e2a\u0e27\u0e22 \u0e41\u0e15\u0e48\u0e2d\u0e48\u0e32\u0e19\u0e22\u0e32\u0e01\u0e08\u0e31\u0e07 \u0e40\u0e19\u0e37\u0e48\u0e2d\u0e07\u0e08\u0e32\u0e01\u0e40\u0e23\u0e32\u0e44\u0e21\u0e48\u0e2d\u0e22\u0e32\u0e01 \u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19 code \u0e43\u0e19\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e02\u0e49\u0e32\u0e07\u0e25\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 (\u0e16\u0e49\u0e32\u0e21\u0e35\u0e04\u0e48\u0e32\u0e40\u0e14\u0e35\u0e22\u0e27\u0e01\u0e47\u0e42\u0e2d\u0e40\u0e04 \u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e2b\u0e25\u0e32\u0e22\u0e04\u0e48\u0e32\u0e01\u0e47\u0e41\u0e22\u0e48\u0e2b\u0e19\u0e48\u0e2d\u0e22) \u0e41\u0e15\u0e48\u0e21\u0e31\u0e19\u0e01\u0e47\u0e15\u0e23\u0e07\u0e44\u0e1b\u0e15\u0e23\u0e07\u0e21\u0e32\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14\u0e41\u0e25\u0e49\u0e27 \u0e40\u0e02\u0e35\u0e22\u0e19\u0e41\u0e1a\u0e1a\u0e02\u0e49\u0e32\u0e07\u0e25\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e19\u0e48\u0e32\u0e08\u0e30\u0e07\u0e48\u0e32\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14 \u0e41\u0e15\u0e48\u0e14\u0e31\u0e19\u0e44\u0e1b\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19&hellip;<\/p>\n","protected":false},"author":1,"featured_media":184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/comments?post=181"}],"version-history":[{"count":2,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/181\/revisions\/186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/media\/184"}],"wp:attachment":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}