Skip to content

Instantly share code, notes, and snippets.

@mykidong
Created May 24, 2018 14:19
Show Gist options
  • Save mykidong/3b22aefc1a213b6d2e29c40dabb37d7f to your computer and use it in GitHub Desktop.
Save mykidong/3b22aefc1a213b6d2e29c40dabb37d7f to your computer and use it in GitHub Desktop.
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;
}
@mykidong
Copy link
Author

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment