if (event.getName() == null || isBlank(event.getName().toString())) { throw new IllegalArgumentException("Event name cannot be null or an empty string");
@Override public Name deserialize(JsonParser parser, DeserializationContext context) throws IOException { return Name.valueOf(parser.getText()); } }
Event.Name actionName = Event.Name.valueOf((String) rollupRow.get(ACTION)); ActionCounts bucketAction = new ActionCounts.Builder() .withActionName(actionName)
.build()); } else { Event.Name actionName = Event.Name.valueOf((String) rollupRow.get(ACTION)); bucket.addActionCounts(actionName, new ActionCounts.Builder() .withActionName(actionName)
void recordEvent(Assignment assignment, Event event) throws Exception { String actionNameString = event.getName().toString(); String payload = (event.getPayload() != null) ? event.getPayload().toString()
Event.Name actionName = Event.Name.valueOf((String) actionRow.get(ACTION)); bucket.addActionCounts(actionName, new ActionCounts.Builder() .withActionName(actionName)
@Override public void serialize(Name name, JsonGenerator generator, SerializerProvider provider) throws IOException { generator.writeString(name.toString()); } }
public void setName(Event.Name value) { name = value; if (name.toString().equals(IMPRESSION)) { type = Type.IMPRESSION; } else { //todo: for other event types, will need to check this.value type = Type.BINARY_ACTION; } }
public static Name valueOf(String value) { return new Name(value); }
@Override public String toString() { return "Event={\"timestamp\":\"" + (timestamp != null ? timestamp : emptyString) + "\"" + ",\"type\":\"" + (type != null ? type.toString() : emptyString) + "\"" + ",\"name\":\"" + (name != null ? name.toString() : emptyString) + "\"" + ",\"context\":\"" + (context != null ? context.toString() : emptyString) + "\"" + ",\"payload\":\"" + (payload != null ? payload.toString() : emptyString) + "\"" + ",\"value\":\"" + (value != null ? value : emptyString) + "\"}"; }