/** Creates a Builder by copying an existing SmallEvent instance */ private Builder(org.kitesdk.data.event.SmallEvent other) { super(org.kitesdk.data.event.SmallEvent.SCHEMA$); if (isValidValue(fields()[0], other.user_id)) { this.user_id = data().deepCopy(fields()[0].schema(), other.user_id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.session_id)) { this.session_id = data().deepCopy(fields()[1].schema(), other.session_id); fieldSetFlags()[1] = true; } }
@Override public SmallEvent build() { try { SmallEvent record = new SmallEvent(); record.user_id = fieldSetFlags()[0] ? this.user_id : (java.lang.Long) defaultValue(fields()[0]); record.session_id = fieldSetFlags()[1] ? this.session_id : (java.lang.String) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'session_id' field has been set */ public boolean hasSessionId() { return fieldSetFlags()[1]; }
/** Creates a new SmallEvent RecordBuilder by copying an existing SmallEvent instance */ public static org.kitesdk.data.event.SmallEvent.Builder newBuilder(org.kitesdk.data.event.SmallEvent other) { return new org.kitesdk.data.event.SmallEvent.Builder(other); }
/** Creates a new SmallEvent RecordBuilder by copying an existing Builder */ public static org.kitesdk.data.event.SmallEvent.Builder newBuilder(org.kitesdk.data.event.SmallEvent.Builder other) { return new org.kitesdk.data.event.SmallEvent.Builder(other); }
/** Creates a new SmallEvent RecordBuilder */ public static org.kitesdk.data.event.SmallEvent.Builder newBuilder() { return new org.kitesdk.data.event.SmallEvent.Builder(); }
/** Clears the value of the 'session_id' field */ public org.kitesdk.data.event.SmallEvent.Builder clearSessionId() { session_id = null; fieldSetFlags()[1] = false; return this; }
/** Checks whether the 'user_id' field has been set */ public boolean hasUserId() { return fieldSetFlags()[0]; }
/** Clears the value of the 'user_id' field */ public org.kitesdk.data.event.SmallEvent.Builder clearUserId() { fieldSetFlags()[0] = false; return this; }
/** Sets the value of the 'user_id' field */ public org.kitesdk.data.event.SmallEvent.Builder setUserId(long value) { validate(fields()[0], value); this.user_id = value; fieldSetFlags()[0] = true; return this; }
private static SmallEvent toSmallEvent(StandardEvent event) { return SmallEvent.newBuilder() .setUserId(event.getUserId()) .setSessionId(event.getSessionId()) .build(); }
/** Sets the value of the 'session_id' field */ public org.kitesdk.data.event.SmallEvent.Builder setSessionId(java.lang.String value) { validate(fields()[1], value); this.session_id = value; fieldSetFlags()[1] = true; return this; }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kitesdk.data.event.SmallEvent.Builder other) { super(other); if (isValidValue(fields()[0], other.user_id)) { this.user_id = data().deepCopy(fields()[0].schema(), other.user_id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.session_id)) { this.session_id = data().deepCopy(fields()[1].schema(), other.session_id); fieldSetFlags()[1] = true; } }