I'm using an java API that I do not own and cannot modify. That API defines a class Aggregation
which is a Immutables
(immutables.github.io) abstract class with Jackson serialization and deserialization.
The class looks like
@Value.Immutable
@JsonSerialize(as = Immutable_Aggregation.class)
@JsonDeserialize(as = Immutable_Aggregation.class)
public abstract class Aggregation {
I want to add a field to Aggregation which should be picked up at serialization time, but instances of which can still be passed to methods accepting Aggregation
.
I want to do something like:
public abstract class ExtendedAggregation extends Aggregation {}
Is this possible?