Skip to content

Commit

Permalink
Merge pull request #148 from gneokleo/master
Browse files Browse the repository at this point in the history
Make ChatAlyticsEvent not depend on Serializable
  • Loading branch information
gneokleo committed Dec 17, 2016
2 parents be615f8 + 19eb4fc commit 21f177c
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
package com.chatalytics.core.model.data;

import com.fasterxml.jackson.annotation.JsonIgnore;

import org.joda.time.DateTime;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Data;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

@Getter
@EqualsAndHashCode
@ToString
@Data
public class ChatAlyticsEvent {

public ChatAlyticsEvent(DateTime eventTime, String type, Serializable event) {
private final DateTime eventTime;
private final String type;
private final Object event;

public ChatAlyticsEvent(DateTime eventTime, String type, Object event) {
this.eventTime = eventTime;
this.type = type;
this.event = event;
this.clazz = event.getClass();
}

private final DateTime eventTime;
private final String type;
private final Serializable event;

@Setter // null out clazz when it leaves the service
private Class<? extends Serializable> clazz;
@JsonIgnore
private Class<?> clazz;
}

0 comments on commit 21f177c

Please sign in to comment.