Created
May 24, 2018 14:19
-
-
Save mykidong/3b22aefc1a213b6d2e29c40dabb37d7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseTranslator { | |
public static class EventLogTranslator extends EventLog implements EventTranslator<EventLog> | |
{ | |
@Override | |
public void translateTo(EventLog eventLog, long sequence) { | |
eventLog.setVersion(this.getVersion()); | |
eventLog.setEventType(this.getEventType()); | |
eventLog.setValue(this.getValue()); | |
} | |
} | |
} | |
public class BaseEvent { | |
private String version; | |
private String eventType; | |
/** | |
* event log json string. | |
*/ | |
private String value; | |
public String getVersion() { | |
return version; | |
} | |
public void setVersion(String version) { | |
this.version = version; | |
} | |
public String getEventType() { | |
return eventType; | |
} | |
public void setEventType(String eventType) { | |
this.eventType = eventType; | |
} | |
public String getValue() { | |
return value; | |
} | |
public void setValue(String value) { | |
this.value = value; | |
} | |
} | |
public class EventLog extends BaseEvent { | |
public final static EventFactory<EventLog> FACTORY = EventLog::new; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.