Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface ConflictedData{
- public void repair();
- }
- class StringConflictedData : ConflictedData {
- public void repair(){
- //do some shit
- }
- }
- class DateConflictedData : ConflictedData {
- public void repair(){
- //do some other shit
- }
- }
- static class ConflictedDataFactory{
- public static ConflictedData getConflictedData(String type){
- if (type.equals("String"))
- return new StringConflictedData();
- if (type.equals("Date"))
- return new DateConflictedData();
- }
- }
Add Comment
Please, Sign In to add comment