Skip to content

Commit

Permalink
ARTEMIS-3932 Move meta bean init to static blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev authored and clebertsuconic committed Dec 18, 2023
1 parent bbfd0f8 commit 177e566
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,61 +93,61 @@ public static class MYClass {

public static MetaBean<MYClass> metaBean = new MetaBean<>();

{
static {
metaBean.add(String.class, "a", (theInstance, parameter) -> theInstance.a = parameter, theInstance -> theInstance.a);
}
String a;

{
static {
metaBean.add(Integer.class, "b", (theInstance, parameter) -> theInstance.b = parameter, theInstance -> theInstance.b);
}
int b;

{
static {
metaBean.add(Integer.class, "c", (theInstance, parameter) -> theInstance.c = parameter, theInstance -> theInstance.c);
}
Integer c;

{
static {
metaBean.add(String.class, "d", (theInstance, parameter) -> theInstance.d = parameter, theInstance -> theInstance.d);
}
String d = "defaultString";

{
static {
metaBean.add(Integer.class, "IdCacheSize", (obj, value) -> obj.setIdCacheSize(value), obj -> obj.getIdCacheSize());
}
Integer idCacheSize;

{
static {
metaBean.add(SimpleString.class, "simpleString", (obj, value) -> obj.setSimpleString(value), obj -> obj.getSimpleString());
}
SimpleString simpleString;

{
static {
metaBean.add(SimpleString.class, "gated", (obj, value) -> obj.setGated((SimpleString) value), obj -> obj.getGated(), obj -> obj.gated != null);
}
SimpleString gated;

{
static {
metaBean.add(Long.class, "longValue", (obj, value) -> obj.setLongValue(value), obj -> obj.getLongValue());
}
Long longValue;
{
static {
metaBean.add(Double.class, "doubleValue", (obj, value) -> obj.setDoubleValue(value), obj -> obj.getDoubleValue());
}
Double doubleValue;

{
static {
metaBean.add(Float.class, "floatValue", (obj, value) -> obj.setFloatValue(value), obj -> obj.getFloatValue());
}
Float floatValue;

{
static {
metaBean.add(Boolean.class, "boolValue", (obj, value) -> obj.boolValue = value, obj -> obj.boolValue);
}
boolean boolValue;

{
static {
metaBean.add(MyEnum.class, "myEnum", (o, v) -> o.myEnum = v, o -> o.myEnum);
}
MyEnum myEnum;
Expand Down

0 comments on commit 177e566

Please sign in to comment.