Guest User

Untitled

a guest
Nov 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. interface ConflictedData{
  2.     public void repair();
  3. }
  4.  
  5. class StringConflictedData : ConflictedData {
  6.     public void repair(){
  7.         //do some shit
  8.     }
  9. }
  10.  
  11. class DateConflictedData : ConflictedData {
  12.     public void repair(){
  13.         //do some other shit
  14.     }
  15. }
  16.  
  17. static class ConflictedDataFactory{
  18.     public static ConflictedData getConflictedData(String type){
  19.         if (type.equals("String"))
  20.             return new StringConflictedData();
  21.         if (type.equals("Date"))
  22.             return new DateConflictedData();
  23.     }
  24. }
Add Comment
Please, Sign In to add comment