I have two classes Car.java and Bus.java
Car.java
private Property property;
Bus.java
private Property property;
The Property.java class has number and colour.
Property.java
private String number;
private String colour;
Depending on where it is called from, Car.java or Bus.java ,I want the properties field to be called carNumber, carColour, busNumber, busColour respectively in the output json.
Is there any way to achieve this using a single property class?
Aucun commentaire:
Enregistrer un commentaire