{"id":213,"date":"2024-02-11T10:54:36","date_gmt":"2024-02-11T09:54:36","guid":{"rendered":"https:\/\/fixthebugs.com\/?p=213"},"modified":"2024-02-11T10:54:37","modified_gmt":"2024-02-11T09:54:37","slug":"requiredargsconstructor-is-not-creating-constructor-with-args","status":"publish","type":"post","link":"https:\/\/fixthebugs.com\/index.php\/2024\/02\/11\/requiredargsconstructor-is-not-creating-constructor-with-args\/","title":{"rendered":"Lombok: RequiredArgsConstructor is not creating constructor with args"},"content":{"rendered":"\n<p><strong>Problem<\/strong>:  When we are using Lombok with @RequiredArgsConstructor and next error appears:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RequiredArgsConstructor is not creating constructor with args<\/code><\/pre>\n\n\n\n<p><strong>Solution<\/strong>: include in the args that you want to use in the constructor <strong>@NonNull<\/strong> or set them as <strong>final<\/strong>.<\/p>\n\n\n\n<p><strong>Explanation<\/strong>: @RequiredArgs only includes in the constructor args with @NonNull or final.<\/p>\n\n\n\n<p>Source: <x> <a rel=\"dofollow noopener\" href=\"https:\/\/projectlombok.org\/features\/constructor\" target=\"_blank\">documentation<\/a><\/x><\/p>\n\n\n\n<p>For more interesting tutorials &amp; guides just check them&nbsp;<a rel=\"dofollow\" href=\"https:\/\/fixthebugs.com\/index.php\/category\/tutorials-guides\/\">HERE<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: When we are using Lombok with @RequiredArgsConstructor and next error appears: Solution: include in the args that you want to use in the constructor @NonNull or set them as final. Explanation: @RequiredArgs only includes in the constructor args with @NonNull or final. Source: documentation For more interesting tutorials &amp; guides just check them&nbsp;HERE.<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[11,9],"tags":[54,55,56,57],"_links":{"self":[{"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":1,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/posts\/213\/revisions\/214"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fixthebugs.com\/index.php\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}