Is it possible to add @Builder and @AllArgsConstructor in static inner classes [Lombok]?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















Basically, the question is if it is possible to add Lombok's @Builder and @AllArgsConstructor to static inner classes?



I tried and it didn't, does anyone knows how to do it, or if it's possible?



I used eclipse, Lombok version 1.18.4.



The code where this happened is confidential, hence I can only show you a little mask version.



error: constructor A in class A cannot be applied to given types;
[ERROR] required: Map<String,B>,String,boolean
[ERROR] found: no arguments
[ERROR] reason: actual and formal argument lists differ in length


A similar error appears for each static inner class, as well as the outer class.



Thanks










share|improve this question




















  • 1





    ...so what was the error you got when you couldn't get it to work?

    – Makoto
    Nov 16 '18 at 17:56











  • Works for me: class OuterClass { @AllArgsConstructor @Builder static class StaticNestedClass { private final String string; } }

    – Tomasz Linkowski
    Nov 16 '18 at 20:40








  • 1





    That also works (with Lombok 1.18.4). Please add to your question the exact error message you get, the Lombok version you use and where the error occurs (in maven, gradle, Eclipse, IntelliJ,...).

    – Jan Rieke
    Nov 16 '18 at 22:29








  • 1





    There is still no error message or exact problem description in your question. Please add that. Otherwise we won't be able to help you.

    – Jan Rieke
    Nov 17 '18 at 10:21






  • 3





    I tried with several inner classes nested up to depth 3, but everything works as expected. We're not getting further without actual code, so you have to boil down your code to a minimal (non-working) example so we can reproduce the error. Please add that to your question.

    – Jan Rieke
    Nov 20 '18 at 18:08




















1















Basically, the question is if it is possible to add Lombok's @Builder and @AllArgsConstructor to static inner classes?



I tried and it didn't, does anyone knows how to do it, or if it's possible?



I used eclipse, Lombok version 1.18.4.



The code where this happened is confidential, hence I can only show you a little mask version.



error: constructor A in class A cannot be applied to given types;
[ERROR] required: Map<String,B>,String,boolean
[ERROR] found: no arguments
[ERROR] reason: actual and formal argument lists differ in length


A similar error appears for each static inner class, as well as the outer class.



Thanks










share|improve this question




















  • 1





    ...so what was the error you got when you couldn't get it to work?

    – Makoto
    Nov 16 '18 at 17:56











  • Works for me: class OuterClass { @AllArgsConstructor @Builder static class StaticNestedClass { private final String string; } }

    – Tomasz Linkowski
    Nov 16 '18 at 20:40








  • 1





    That also works (with Lombok 1.18.4). Please add to your question the exact error message you get, the Lombok version you use and where the error occurs (in maven, gradle, Eclipse, IntelliJ,...).

    – Jan Rieke
    Nov 16 '18 at 22:29








  • 1





    There is still no error message or exact problem description in your question. Please add that. Otherwise we won't be able to help you.

    – Jan Rieke
    Nov 17 '18 at 10:21






  • 3





    I tried with several inner classes nested up to depth 3, but everything works as expected. We're not getting further without actual code, so you have to boil down your code to a minimal (non-working) example so we can reproduce the error. Please add that to your question.

    – Jan Rieke
    Nov 20 '18 at 18:08
















1












1








1








Basically, the question is if it is possible to add Lombok's @Builder and @AllArgsConstructor to static inner classes?



I tried and it didn't, does anyone knows how to do it, or if it's possible?



I used eclipse, Lombok version 1.18.4.



The code where this happened is confidential, hence I can only show you a little mask version.



error: constructor A in class A cannot be applied to given types;
[ERROR] required: Map<String,B>,String,boolean
[ERROR] found: no arguments
[ERROR] reason: actual and formal argument lists differ in length


A similar error appears for each static inner class, as well as the outer class.



Thanks










share|improve this question
















Basically, the question is if it is possible to add Lombok's @Builder and @AllArgsConstructor to static inner classes?



I tried and it didn't, does anyone knows how to do it, or if it's possible?



I used eclipse, Lombok version 1.18.4.



The code where this happened is confidential, hence I can only show you a little mask version.



error: constructor A in class A cannot be applied to given types;
[ERROR] required: Map<String,B>,String,boolean
[ERROR] found: no arguments
[ERROR] reason: actual and formal argument lists differ in length


A similar error appears for each static inner class, as well as the outer class.



Thanks







java inner-classes lombok boilerplate






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 11:04







pedroth

















asked Nov 16 '18 at 17:49









pedrothpedroth

5115




5115








  • 1





    ...so what was the error you got when you couldn't get it to work?

    – Makoto
    Nov 16 '18 at 17:56











  • Works for me: class OuterClass { @AllArgsConstructor @Builder static class StaticNestedClass { private final String string; } }

    – Tomasz Linkowski
    Nov 16 '18 at 20:40








  • 1





    That also works (with Lombok 1.18.4). Please add to your question the exact error message you get, the Lombok version you use and where the error occurs (in maven, gradle, Eclipse, IntelliJ,...).

    – Jan Rieke
    Nov 16 '18 at 22:29








  • 1





    There is still no error message or exact problem description in your question. Please add that. Otherwise we won't be able to help you.

    – Jan Rieke
    Nov 17 '18 at 10:21






  • 3





    I tried with several inner classes nested up to depth 3, but everything works as expected. We're not getting further without actual code, so you have to boil down your code to a minimal (non-working) example so we can reproduce the error. Please add that to your question.

    – Jan Rieke
    Nov 20 '18 at 18:08
















  • 1





    ...so what was the error you got when you couldn't get it to work?

    – Makoto
    Nov 16 '18 at 17:56











  • Works for me: class OuterClass { @AllArgsConstructor @Builder static class StaticNestedClass { private final String string; } }

    – Tomasz Linkowski
    Nov 16 '18 at 20:40








  • 1





    That also works (with Lombok 1.18.4). Please add to your question the exact error message you get, the Lombok version you use and where the error occurs (in maven, gradle, Eclipse, IntelliJ,...).

    – Jan Rieke
    Nov 16 '18 at 22:29








  • 1





    There is still no error message or exact problem description in your question. Please add that. Otherwise we won't be able to help you.

    – Jan Rieke
    Nov 17 '18 at 10:21






  • 3





    I tried with several inner classes nested up to depth 3, but everything works as expected. We're not getting further without actual code, so you have to boil down your code to a minimal (non-working) example so we can reproduce the error. Please add that to your question.

    – Jan Rieke
    Nov 20 '18 at 18:08










1




1





...so what was the error you got when you couldn't get it to work?

– Makoto
Nov 16 '18 at 17:56





...so what was the error you got when you couldn't get it to work?

– Makoto
Nov 16 '18 at 17:56













Works for me: class OuterClass { @AllArgsConstructor @Builder static class StaticNestedClass { private final String string; } }

– Tomasz Linkowski
Nov 16 '18 at 20:40







Works for me: class OuterClass { @AllArgsConstructor @Builder static class StaticNestedClass { private final String string; } }

– Tomasz Linkowski
Nov 16 '18 at 20:40






1




1





That also works (with Lombok 1.18.4). Please add to your question the exact error message you get, the Lombok version you use and where the error occurs (in maven, gradle, Eclipse, IntelliJ,...).

– Jan Rieke
Nov 16 '18 at 22:29







That also works (with Lombok 1.18.4). Please add to your question the exact error message you get, the Lombok version you use and where the error occurs (in maven, gradle, Eclipse, IntelliJ,...).

– Jan Rieke
Nov 16 '18 at 22:29






1




1





There is still no error message or exact problem description in your question. Please add that. Otherwise we won't be able to help you.

– Jan Rieke
Nov 17 '18 at 10:21





There is still no error message or exact problem description in your question. Please add that. Otherwise we won't be able to help you.

– Jan Rieke
Nov 17 '18 at 10:21




3




3





I tried with several inner classes nested up to depth 3, but everything works as expected. We're not getting further without actual code, so you have to boil down your code to a minimal (non-working) example so we can reproduce the error. Please add that to your question.

– Jan Rieke
Nov 20 '18 at 18:08







I tried with several inner classes nested up to depth 3, but everything works as expected. We're not getting further without actual code, so you have to boil down your code to a minimal (non-working) example so we can reproduce the error. Please add that to your question.

– Jan Rieke
Nov 20 '18 at 18:08














0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53342982%2fis-it-possible-to-add-builder-and-allargsconstructor-in-static-inner-classes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53342982%2fis-it-possible-to-add-builder-and-allargsconstructor-in-static-inner-classes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

The Sandy Post

Danny Elfman

Pages that link to "Head v. Amoskeag Manufacturing Co."