I have the same method in 2 classes that copy fields from one object to builders. I want to refactor it but I do not know if I should create a static method in an utility class or abstract it to a superclass.
The classes that shares this code are Beans and part of a multithreading app.
The method would be like:
protected static void copyPartyGroup(Message.Builder msgBuilder,
final PartyGroup partyIDsGroup, Party.Builder rartyBuilder) {
rartyBuilder.setPartyID(partyIDsGroup.getId())
....
msgBuilder.setID(partyIDsGroup.getId())
....
}
Thank you very much for your help.