Could not find which method () to invoke from this list on newInstance in groovy closure

后端 未结 1 618
闹比i
闹比i 2021-01-12 17:41

I am learning groovy and I am trying to initialize my class dynamically with default values for all fields. So how I am proceeding is, I am taking the list of all the proper

相关标签:
1条回答
  • 2021-01-12 18:11

    View the java docs for java.lang.Boolean. As you can see in the section Constructor Summary there's no no-arg constructor (and this is what exception message says) for this class. You must either:

    • invoke it (constructor) with boolean or String argument
    • use default value for boolean - which is false
    • initialize the value with Boolean.FALSE or Boolean.TRUE
    0 讨论(0)
提交回复
热议问题