/** Creates a Builder by copying an existing NotificationSyncRequest instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest other) { super(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.SCHEMA$); if (isValidValue(fields()[0], other.topicListHash)) { this.topicListHash = data().deepCopy(fields()[0].schema(), other.topicListHash); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.topicStates)) { this.topicStates = data().deepCopy(fields()[1].schema(), other.topicStates); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.acceptedUnicastNotifications)) { this.acceptedUnicastNotifications = data().deepCopy(fields()[2].schema(), other.acceptedUnicastNotifications); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.subscriptionCommands)) { this.subscriptionCommands = data().deepCopy(fields()[3].schema(), other.subscriptionCommands); fieldSetFlags()[3] = true; } }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder other) { super(other); if (isValidValue(fields()[0], other.topicListHash)) { this.topicListHash = data().deepCopy(fields()[0].schema(), other.topicListHash); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.topicStates)) { this.topicStates = data().deepCopy(fields()[1].schema(), other.topicStates); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.acceptedUnicastNotifications)) { this.acceptedUnicastNotifications = data().deepCopy(fields()[2].schema(), other.acceptedUnicastNotifications); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.subscriptionCommands)) { this.subscriptionCommands = data().deepCopy(fields()[3].schema(), other.subscriptionCommands); fieldSetFlags()[3] = true; } }
@Override public NotificationSyncRequest build() { try { NotificationSyncRequest record = new NotificationSyncRequest(); record.topicListHash = fieldSetFlags()[0] ? this.topicListHash : (java.lang.Integer) defaultValue(fields()[0]); record.topicStates = fieldSetFlags()[1] ? this.topicStates : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState>) defaultValue(fields()[1]); record.acceptedUnicastNotifications = fieldSetFlags()[2] ? this.acceptedUnicastNotifications : (java.util.List<java.lang.String>) defaultValue(fields()[2]); record.subscriptionCommands = fieldSetFlags()[3] ? this.subscriptionCommands : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand>) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'subscriptionCommands' field has been set */ public boolean hasSubscriptionCommands() { return fieldSetFlags()[3]; }
/** Checks whether the 'acceptedUnicastNotifications' field has been set */ public boolean hasAcceptedUnicastNotifications() { return fieldSetFlags()[2]; }
/** Checks whether the 'topicListHash' field has been set */ public boolean hasTopicListHash() { return fieldSetFlags()[0]; }
/** Clears the value of the 'subscriptionCommands' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearSubscriptionCommands() { subscriptionCommands = null; fieldSetFlags()[3] = false; return this; }
/** Clears the value of the 'acceptedUnicastNotifications' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearAcceptedUnicastNotifications() { acceptedUnicastNotifications = null; fieldSetFlags()[2] = false; return this; }
/** Clears the value of the 'topicStates' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearTopicStates() { topicStates = null; fieldSetFlags()[1] = false; return this; }
/** Checks whether the 'topicStates' field has been set */ public boolean hasTopicStates() { return fieldSetFlags()[1]; }
/** Sets the value of the 'topicStates' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setTopicStates(java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> value) { validate(fields()[1], value); this.topicStates = value; fieldSetFlags()[1] = true; return this; }
/** Sets the value of the 'topicListHash' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setTopicListHash(int value) { validate(fields()[0], value); this.topicListHash = value; fieldSetFlags()[0] = true; return this; }
/** Sets the value of the 'subscriptionCommands' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setSubscriptionCommands(java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> value) { validate(fields()[3], value); this.subscriptionCommands = value; fieldSetFlags()[3] = true; return this; }
/** Sets the value of the 'acceptedUnicastNotifications' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setAcceptedUnicastNotifications(java.util.List<java.lang.String> value) { validate(fields()[2], value); this.acceptedUnicastNotifications = value; fieldSetFlags()[2] = true; return this; }
/** Clears the value of the 'topicListHash' field */ public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearTopicListHash() { fieldSetFlags()[0] = false; return this; }