{"id":100,"date":"2020-03-12T18:05:50","date_gmt":"2020-03-12T09:05:50","guid":{"rendered":"http:\/\/www.skyer9.pe.kr\/wordpress\/?p=100"},"modified":"2020-03-12T18:42:59","modified_gmt":"2020-03-12T09:42:59","slug":"lombok","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=100","title":{"rendered":"Lombok"},"content":{"rendered":"<h1>Lombok<\/h1>\n<p>\ub86c\ubcf5\uc740 \uc18c\uc2a4 \uc0dd\uc131\uc744 \uc790\ub3d9\ud654 \ud574\uc8fc\ub294 \ud234\uc785\ub2c8\ub2e4.<\/p>\n<h2>\uc5b4\ub178\ud14c\uc774\uc158 \uc77c\ub78c<\/h2>\n<h3>@Getter<\/h3>\n<p>get \uba54\uc18c\ub4dc\ub97c \uc790\ub3d9 \uc0dd\uc131\ud574 \uc90d\ub2c8\ub2e4. \uc4f0\uace0 \uc548\uc4f0\uace0\uc758 \ucc28\uc774\uac00 \ub9ce\uc774 \ub0a9\ub2c8\ub2e4.<\/p>\n<p>\uc18c\uc2a4 \ub77c\uc778\uc218\uac00 \uae09\uc99d\ud558\uace0 \ub0b4\ubd80 \ubcc0\uc218 \ud558\ub098 \ucd94\uac00 \uc0ad\uc81c \ud560\ub54c\ub9c8\ub2e4 get \uba54\uc18c\ub4dc\ub97c \ucd94\uac00 \uc0ad\uc81c\ub97c \ud574\uc8fc\uc5b4\uc57c \ud558\ub294 \ubb38\uc81c\uac00 \uc0dd\uae41\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">\/\/ with @Getter annotation\n@Getter\npublic class OrderMaster {\n    String orderserial;\n    String cancelYn;\n    LocalDateTime canceldate;\n}\n\n\/\/ without @Getter annotation\npublic class OrderMaster {\n    String orderserial;\n    String cancelYn;\n    LocalDateTime canceldate;\n\n    public String getOrderserial() {\n        return orderserial;\n    }\n\n    public String getCancelYn() {\n        return cancelYn;\n    }\n\n    public LocalDateTime getCanceldate() {\n        return canceldate;\n    }\n}<\/code><\/pre>\n<h3>@Setter<\/h3>\n<p>@Getter \uc640 \ube44\uc2b7\ud558\uc9c0\ub9cc \ube44\uad8c\uc7a5 \uc5b4\ub178\ud14c\uc774\uc158\uc785\ub2c8\ub2e4.<\/p>\n<p>\ube44\uad8c\uc7a5 \uc774\uc720\ub294 \uc544\ub798\uc5d0 \ubaa8\uc544\uc11c \uc124\uba85\ud569\ub2c8\ub2e4.<\/p>\n<h3>@ToString<\/h3>\n<p>toString() \uba54\uc18c\ub4dc\ub97c \uc790\ub3d9\uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">@ToString(exclude = &quot;password&quot;)\npublic class User {\n    private Long id;\n    private String username;\n    private String password;\n    private int[] scores;\n}<\/code><\/pre>\n<h3>@NoArgsConstructor<\/h3>\n<p>\ud30c\ub77c\ubbf8\ud130\uac00 \ud558\ub098\ub3c4 \uc5c6\ub294 \uc0dd\uc131\uc790\ub97c \uc790\ub3d9\uc0dd\uc131\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">\/\/ with @NoArgsConstructor annotation\n@NoArgsConstructor\npublic class OrderMaster {\n    String orderserial;\n    String cancelYn;\n    LocalDateTime canceldate;\n}\n\n\/\/ without @NoArgsConstructor annotation\npublic class OrderMaster {\n    String orderserial;\n    String cancelYn;\n    LocalDateTime canceldate;\n\n    public OrderMaster() {\n    }\n}<\/code><\/pre>\n<h3>@RequriedArgsConstructor<\/h3>\n<p>\ub0b4\ubd80 \ubcc0\uc218\uc911 <code>final<\/code> \ub610\ub294 <code>@NonNull<\/code> \uc774 \ubd99\uc5b4 \uc788\ub294 \ubcc0\uc218\ub4e4\ub9cc\uc73c\ub85c \uad6c\uc131\ub41c \uc0dd\uc131\uc790\ub97c \ub9cc\ub4ed\ub2c8\ub2e4.<\/p>\n<h3>@AllArgsConstructor<\/h3>\n<p>\ube44\uad8c\uc7a5 \uc5b4\ub178\ud14c\uc774\uc158\uc785\ub2c8\ub2e4.<\/p>\n<p>\ube44\uad8c\uc7a5 \uc774\uc720\ub294 \uc544\ub798\uc5d0 \ubaa8\uc544\uc11c \uc124\uba85\ud569\ub2c8\ub2e4.<\/p>\n<h3>@Builder<\/h3>\n<p>\ud30c\ub77c\ubbf8\ud130\uac00 \ub2e4\uc218\uc778 \uc0dd\uc131\uc790\uc758 \uacbd\uc6b0, \ud30c\ub77c\ubbf8\ud130\uc758 \uc21c\uc11c\ub97c \uc798\ubabb \uc9c0\uc815\ud574\uc11c \ucc3e\uc544\ub0b4\uae30 \ud798\ub4e0 \uc624\ub958\ub97c \ub9cc\ub4e4\uae30 \uc27d\uc2b5\ub2c8\ub2e4. \uadf8\ub7f4\ub54c <code>Builder<\/code> \ub97c \uc0dd\uc131\ud558\ub294\ub370, \uc774\ub97c \uc790\ub3d9\ud654 \ud574\uc8fc\ub294 \uc5b4\ub178\ud14c\uc774\uc158\uc785\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">@Getter\n@NoArgsConstructor\npublic class Posts extends BaseTimeEntity {\n\n    private long id;\n\n    private String title;\n\n    private String content;\n\n    private String author;\n\n    @Builder\n    public Posts(String title, String content, String author) {\n        this.title = title;\n        this.content = content;\n        this.author = author;\n    }\n}\n\nPosts posts = Posts.builder()\n        .title(&quot;titlt&quot;)\n        .content(&quot;content&quot;)\n        .author(&quot;author&quot;)\n        .build();<\/code><\/pre>\n<h3>@NonNull<\/h3>\n<p>\ubcc0\uc218\uc5d0 null \uc774 \uc785\ub825\ub418\uba74 NullPointerException \uc744 \ubc1c\uc0dd\uc2dc\ud0b5\ub2c8\ub2e4. null \uc744 \uc785\ub825\ud560 \ub54c \uc624\ub958\ub97c \ubc1c\uc0dd\uc2dc\ud0a4\uba74 \uc624\ub958 \ubc1c\uc0dd\uc2dc\uae30\uac00 \uba85\ud655\ud574\uc838\uc11c \uc624\ub958 \ucc3e\uae30\uac00 \uc26c\uc6cc\uc9d1\ub2c8\ub2e4.<\/p>\n<p>\ub0b4\ubd80\ubcc0\uc218\uc758 \uc124\uc815\uc740, \uc0dd\uc131\uc790 \ub610\ub294 \ub0b4\ubd80\ubcc0\uc218\uc5d0 \uac12\uc744 \uc785\ub825\ud558\ub294 \ud2b9\uc815 \uba54\uc18c\ub4dc \ud638\ucd9c\uc5d0 \uc758\ud574 \uba85\ud655\ud788 \uc815\ud574\uc9d0\uc5d0 \ubc18\ud574, \uc785\ub825\uc2dc\uac00 \uc544\ub2c8\ub77c \uc0ac\uc6a9\uc2dc \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud558\uac8c \ub418\uba74, \uc5b4\ub290 \uc2dc\uc810\uc5d0 null \uc774 \uc785\ub825\ub418\uc5c8\ub294\uc9c0 \ucc3e\uc744 \uc218\uac00 \uc5c6\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">@Getter\npublic class MyOrderMaster {\n    String orderserial;\n\n    @NonNull\n    String cancelYn;\n\n    LocalDateTime canceldate;\n}<\/code><\/pre>\n<h3>@Data<\/h3>\n<p>\ube44\uad8c\uc7a5 \uc5b4\ub178\ud14c\uc774\uc158\uc785\ub2c8\ub2e4.<\/p>\n<p>\ube44\uad8c\uc7a5 \uc774\uc720\ub294 \uc544\ub798\uc5d0 \ubaa8\uc544\uc11c \uc124\uba85\ud569\ub2c8\ub2e4.<\/p>\n<h2>\ube44\uad8c\uc7a5 \uc5b4\ub178\ud14c\uc774\uc158<\/h2>\n<h3>@Setter<\/h3>\n<p>\ubcc0\uc218\ub97c \uc784\uc758\ub85c \ubcc0\uacbd\ud558\uba74 \uc624\ub958\ub97c \ucc3e\uc544\ub0b4\uae30 \ud798\ub4e4\uc5b4\uc9d1\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">@Setter\n@NoArgsConstructor\npublic class MyOrderMaster {\n    String orderserial;\n    String cancelYn;\n    LocalDateTime canceldate;\n}\n\nMyOrderMaster myOrderMaster = new MyOrderMaster();\nmyOrderMaster.setCancelYn(&quot;Y&quot;);<\/code><\/pre>\n<pre><code class=\"language-java\">@NoArgsConstructor\npublic class MyOrderMaster {\n    String orderserial;\n    String cancelYn;\n    LocalDateTime canceldate;\n\n    public void cancelOrder() {\n        this.cancelYn = &quot;Y&quot;;\n        this.canceldate = LocalDateTime.now();\n    }\n}\n\nMyOrderMaster myOrderMaster = new MyOrderMaster();\nmyOrderMaster.cancelOrder();<\/code><\/pre>\n<h3>@AllArgsConstructor<\/h3>\n<p>Builder \ubc29\uc2dd \ub300\uc2e0 \ubaa8\ub4e0 \ub0b4\ubd80\ubcc0\uc218\ub97c \ub098\uc5f4\ud558\ub294 \ubc29\uc2dd\uc758 \uc0dd\uc131\uc790\ub97c \uc0dd\uc131\ud558\uace0, \uc544\ub798\uc640 \uac19\uc774 \ubcc0\uc218\ud0c0\uc785\uc774 \ubaa8\ub450 \ub3d9\uc77c\ud55c \uacbd\uc6b0, \ud55c \uac1c\ubc1c\uc790\uac00 \ubcc0\uc218\uc758 \uc21c\uc11c\ub97c \ubcc0\uacbd\ud558\uba74, \ucc3e\uc544\ub0b4\uae30 \ub9e4\uc6b0 \uc5b4\ub824\uc6b4 \ubc84\uadf8\uac00 \ubc1c\uc0dd\ud569\ub2c8\ub2e4.<\/p>\n<p>\ub530\ub77c\uc11c, <code>@AllArgsConstructor<\/code> \uc758 \uc0ac\uc6a9\uc744 \uc81c\ud55c\ud558\uace0, <code>@Builder<\/code> \ub97c \uc774\uc6a9\ud574 \uac1d\uccb4\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uc624\ub958 \ubc1c\uc0dd\uc744 \ucc28\ub2e8\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">@AllArgsConstructor\npublic class Posts extends BaseTimeEntity {\n    private String title;\n    private String content;\n    private String author;\n}\n\nPosts posts = new Posts(&quot;title&quot;, &quot;content&quot;, &quot;author&quot;);<\/code><\/pre>\n<h3>@Data<\/h3>\n<p><code>@Data<\/code> \uc5b4\ub108\ud14c\uc774\uc158\uc740 @ToString, @EqualsAndHashCode, @Getter, @Setter, @RequiredArgsConstructor \ub97c \ud55c\ubc88\uc5d0 \uc0dd\uc131\ud574 \uc8fc\ub294 \uc5b4\ub178\ud14c\uc774\uc158\uc785\ub2c8\ub2e4.<\/p>\n<p>\ube44\uad8c\uc7a5 \uc5b4\ub178\ud14c\uc774\uc158\uc744 \uc0dd\uc131\ud558\uace0, \ub108\ubb34 \ub9ce\uc740 \uc5b4\ub178\ud14c\uc774\uc158\ub4e4\uc774 \ud55c\ubc88\uc5d0 \uc0dd\uc131\ub418\uc5b4 \uad8c\uc7a5\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lombok \ub86c\ubcf5\uc740 \uc18c\uc2a4 \uc0dd\uc131\uc744 \uc790\ub3d9\ud654 \ud574\uc8fc\ub294 \ud234\uc785\ub2c8\ub2e4. \uc5b4\ub178\ud14c\uc774\uc158 \uc77c\ub78c @Getter get \uba54\uc18c\ub4dc\ub97c \uc790\ub3d9 \uc0dd\uc131\ud574 \uc90d\ub2c8\ub2e4. \uc4f0\uace0 \uc548\uc4f0\uace0\uc758 \ucc28\uc774\uac00 \ub9ce\uc774 \ub0a9\ub2c8\ub2e4. \uc18c\uc2a4 \ub77c\uc778\uc218\uac00 \uae09\uc99d\ud558\uace0 \ub0b4\ubd80 \ubcc0\uc218 \ud558\ub098 \ucd94\uac00 \uc0ad\uc81c \ud560\ub54c\ub9c8\ub2e4 get \uba54\uc18c\ub4dc\ub97c \ucd94\uac00 \uc0ad\uc81c\ub97c \ud574\uc8fc\uc5b4\uc57c \ud558\ub294 \ubb38\uc81c\uac00 \uc0dd\uae41\ub2c8\ub2e4. \/\/ with @Getter annotation @Getter public class OrderMaster { String orderserial; String cancelYn; LocalDateTime canceldate; } \/\/ without\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=100\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":9,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}