Context
Version: 1.4.1
JDK: 8
When defining configuration POJO beans mapped by ConfigMe's BeanPropertyType, using fluent setter methods (such as those generated by Lombok's @Accessors(chain = true) or custom return this; setters) breaks the JavaBean property introspection.
Reproducing Example
Consider a simplified configuration bean:
import lombok.*;
import lombok.experimental.Accessors;
@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor(access = AccessLevel.PUBLIC)
public class CustomConfigProperty {
private boolean enabled = true;
private String fileName = "";
private int weight = 1;
private int minHeight = 0;
private int maxHeight = 255;
}
When registering and saving this bean via ConfigMe:
public static final Property<CustomConfigProperty[]> PROPERTIES =
new PropertyBuilder.ArrayPropertyBuilder<>(
new BeanPropertyType<>(new TypeInformation(CustomConfigProperty.class), DefaultMapper.getInstance()),
CustomConfigProperty[]::new)
.path("custom.properties")
.defaultValue(new CustomConfigProperty[0])
.build();
Expected Behavior
ConfigMe should map the bean's fields to YAML properties based on getters and setters.
Actual Behavior
ConfigMe does not recognize the fluent setters, resulting in empty YAML outputs or unpopulated instances when reading from configuration files.
Thank you ❤️
Context
Version: 1.4.1
JDK: 8
When defining configuration POJO beans mapped by ConfigMe's
BeanPropertyType, using fluent setter methods (such as those generated by Lombok's@Accessors(chain = true)or customreturn this;setters) breaks the JavaBean property introspection.Reproducing Example
Consider a simplified configuration bean:
When registering and saving this bean via ConfigMe:
Expected Behavior
ConfigMe should map the bean's fields to YAML properties based on getters and setters.
Actual Behavior
ConfigMe does not recognize the fluent setters, resulting in empty YAML outputs or unpopulated instances when reading from configuration files.
Thank you ❤️