line-bot-sdk-java
line-bot-sdk-java copied to clipboard
[Feature Request] Make all model class re-constructable / modifiable.
Feature Request
Describe the solution you'd like
Changing specific field of model class (e.g. FlexMessage) is hard work for developer.
Adding lombok's @Builder(toBuilder = true)
save us.
(And optionally, @Wither
is also useful)
Describe alternatives you've considered
FlexMessage overWriteDirection(FlexMessage original) {
Bubble originalBubble = (Bubble) original.getContents();
FlexMessage modified = original
.toBuilder()
.contents(Bubble.builder()
.action(originalBubble.getAction())
.direction(FlexDirection.RTL)
.body(originalBubble.getBody())
.footer(originalBubble.getFooter())
.header(originalBubble.getHeader())
.hero(originalBubble.getHero())
.size(originalBubble.getSize())
.build())
.build();
return modified;
// Result: Error because copying Bubble#style is missing... :sob:
}
https://github.com/line/line-bot-sdk-java/pull/254
Can we close this issue?
Thank you for remind me. Actually I think there are missing task in this ticket.
Especially, classes out of model/event
will not changed in last PR.
(PR = Use builder style in model/event class to make adding field more easyly and safely. #254 )
Let me leave this ticket open.