/** * Appends the specified element to the end of this list. * * @param message the message to add * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> addMessage( MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.add(message); if (builders != null) { builders.add(null); } onChanged(); incrementModCounts(); return this; }
/** * Appends the specified element to the end of this list. * * @param message the message to add * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> addMessage( MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.add(message); if (builders != null) { builders.add(null); } onChanged(); incrementModCounts(); return this; }
/** * Appends the specified element to the end of this list. * * @param message the message to add * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> addMessage( MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.add(message); if (builders != null) { builders.add(null); } onChanged(); incrementModCounts(); return this; }
/** * Inserts the specified message at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the message * @param message the message to add * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> addMessage( int index, MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.add(index, message); if (builders != null) { builders.add(index, null); } onChanged(); incrementModCounts(); return this; }
/** * Removes all of the elements from this list. * The list will be empty after this call returns. */ public void clear() { messages = Collections.emptyList(); isMessagesListMutable = false; if (builders != null) { for (SingleFieldBuilder<MType, BType, IType> entry : builders) { if (entry != null) { entry.dispose(); } } builders = null; } onChanged(); incrementModCounts(); }
/** * Inserts the specified message at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the message * @param message the message to add * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> addMessage( int index, MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.add(index, message); if (builders != null) { builders.add(index, null); } onChanged(); incrementModCounts(); return this; }
/** * Inserts the specified message at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the message * @param message the message to add * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> addMessage( int index, MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.add(index, message); if (builders != null) { builders.add(index, null); } onChanged(); incrementModCounts(); return this; }
/** * Removes all of the elements from this list. * The list will be empty after this call returns. */ public void clear() { messages = Collections.emptyList(); isMessagesListMutable = false; if (builders != null) { for (SingleFieldBuilder<MType, BType, IType> entry : builders) { if (entry != null) { entry.dispose(); } } builders = null; } onChanged(); incrementModCounts(); }
/** * Removes all of the elements from this list. * The list will be empty after this call returns. */ public void clear() { messages = Collections.emptyList(); isMessagesListMutable = false; if (builders != null) { for (SingleFieldBuilder<MType, BType, IType> entry : builders) { if (entry != null) { entry.dispose(); } } builders = null; } onChanged(); incrementModCounts(); }
/** * Sets a message at the specified index replacing the existing item at * that index. * * @param index the index to set. * @param message the message to set * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> setMessage( int index, MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.set(index, message); if (builders != null) { SingleFieldBuilder<MType, BType, IType> entry = builders.set(index, null); if (entry != null) { entry.dispose(); } } onChanged(); incrementModCounts(); return this; }
/** * Removes the element at the specified position in this list. Shifts any * subsequent elements to the left (subtracts one from their indices). * Returns the element that was removed from the list. * * @param index the index at which to remove the message */ public void remove(int index) { ensureMutableMessageList(); messages.remove(index); if (builders != null) { SingleFieldBuilder<MType, BType, IType> entry = builders.remove(index); if (entry != null) { entry.dispose(); } } onChanged(); incrementModCounts(); }
/** * Removes the element at the specified position in this list. Shifts any * subsequent elements to the left (subtracts one from their indices). * Returns the element that was removed from the list. * * @param index the index at which to remove the message */ public void remove(int index) { ensureMutableMessageList(); messages.remove(index); if (builders != null) { SingleFieldBuilder<MType, BType, IType> entry = builders.remove(index); if (entry != null) { entry.dispose(); } } onChanged(); incrementModCounts(); }
/** * Removes the element at the specified position in this list. Shifts any * subsequent elements to the left (subtracts one from their indices). * Returns the element that was removed from the list. * * @param index the index at which to remove the message */ public void remove(int index) { ensureMutableMessageList(); messages.remove(index); if (builders != null) { SingleFieldBuilder<MType, BType, IType> entry = builders.remove(index); if (entry != null) { entry.dispose(); } } onChanged(); incrementModCounts(); }
/** * Sets a message at the specified index replacing the existing item at * that index. * * @param index the index to set. * @param message the message to set * @return the builder */ public RepeatedFieldBuilder<MType, BType, IType> setMessage( int index, MType message) { if (message == null) { throw new NullPointerException(); } ensureMutableMessageList(); messages.set(index, message); if (builders != null) { SingleFieldBuilder<MType, BType, IType> entry = builders.set(index, null); if (entry != null) { entry.dispose(); } } onChanged(); incrementModCounts(); return this; }
/** * Appends a new builder to the end of this list and returns the builder. * * @param message the message to add which is the basis of the builder * @return the new builder */ public BType addBuilder(MType message) { ensureMutableMessageList(); ensureBuilders(); SingleFieldBuilder<MType, BType, IType> builder = new SingleFieldBuilder<MType, BType, IType>( message, this, isClean); messages.add(null); builders.add(builder); onChanged(); incrementModCounts(); return builder.getBuilder(); }
/** * Appends a new builder to the end of this list and returns the builder. * * @param message the message to add which is the basis of the builder * @return the new builder */ public BType addBuilder(MType message) { ensureMutableMessageList(); ensureBuilders(); SingleFieldBuilder<MType, BType, IType> builder = new SingleFieldBuilder<MType, BType, IType>( message, this, isClean); messages.add(null); builders.add(builder); onChanged(); incrementModCounts(); return builder.getBuilder(); }
/** * Inserts a new builder at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the builder * @param message the message to add which is the basis of the builder * @return the builder */ public BType addBuilder(int index, MType message) { ensureMutableMessageList(); ensureBuilders(); SingleFieldBuilder<MType, BType, IType> builder = new SingleFieldBuilder<MType, BType, IType>( message, this, isClean); messages.add(index, null); builders.add(index, builder); onChanged(); incrementModCounts(); return builder.getBuilder(); }
/** * Appends a new builder to the end of this list and returns the builder. * * @param message the message to add which is the basis of the builder * @return the new builder */ public BType addBuilder(MType message) { ensureMutableMessageList(); ensureBuilders(); SingleFieldBuilder<MType, BType, IType> builder = new SingleFieldBuilder<MType, BType, IType>( message, this, isClean); messages.add(null); builders.add(builder); onChanged(); incrementModCounts(); return builder.getBuilder(); }
/** * Inserts a new builder at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the builder * @param message the message to add which is the basis of the builder * @return the builder */ public BType addBuilder(int index, MType message) { ensureMutableMessageList(); ensureBuilders(); SingleFieldBuilder<MType, BType, IType> builder = new SingleFieldBuilder<MType, BType, IType>( message, this, isClean); messages.add(index, null); builders.add(index, builder); onChanged(); incrementModCounts(); return builder.getBuilder(); }
/** * Inserts a new builder at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the builder * @param message the message to add which is the basis of the builder * @return the builder */ public BType addBuilder(int index, MType message) { ensureMutableMessageList(); ensureBuilders(); SingleFieldBuilder<MType, BType, IType> builder = new SingleFieldBuilder<MType, BType, IType>( message, this, isClean); messages.add(index, null); builders.add(index, builder); onChanged(); incrementModCounts(); return builder.getBuilder(); }