/** Creates a Builder by copying an existing BasicUserNotification instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification other) { super(org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification.SCHEMA$); if (isValidValue(fields()[0], other.notificationBody)) { this.notificationBody = data().deepCopy(fields()[0].schema(), other.notificationBody); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.userNotificationParam)) { this.userNotificationParam = data().deepCopy(fields()[1].schema(), other.userNotificationParam); fieldSetFlags()[1] = true; } }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification.Builder other) { super(other); if (isValidValue(fields()[0], other.notificationBody)) { this.notificationBody = data().deepCopy(fields()[0].schema(), other.notificationBody); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.userNotificationParam)) { this.userNotificationParam = data().deepCopy(fields()[1].schema(), other.userNotificationParam); fieldSetFlags()[1] = true; } }
@Override public BasicUserNotification build() { try { BasicUserNotification record = new BasicUserNotification(); record.notificationBody = fieldSetFlags()[0] ? this.notificationBody : (java.lang.String) defaultValue(fields()[0]); record.userNotificationParam = fieldSetFlags()[1] ? this.userNotificationParam : (java.lang.Integer) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'userNotificationParam' field has been set */ public boolean hasUserNotificationParam() { return fieldSetFlags()[1]; }
/** Checks whether the 'notificationBody' field has been set */ public boolean hasNotificationBody() { return fieldSetFlags()[0]; }
/** Sets the value of the 'userNotificationParam' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification.Builder setUserNotificationParam(int value) { validate(fields()[1], value); this.userNotificationParam = value; fieldSetFlags()[1] = true; return this; }
/** Clears the value of the 'notificationBody' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification.Builder clearNotificationBody() { notificationBody = null; fieldSetFlags()[0] = false; return this; }
/** Clears the value of the 'userNotificationParam' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification.Builder clearUserNotificationParam() { fieldSetFlags()[1] = false; return this; }
/** Sets the value of the 'notificationBody' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicUserNotification.Builder setNotificationBody(java.lang.String value) { validate(fields()[0], value); this.notificationBody = value; fieldSetFlags()[0] = true; return this; }