/** * 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(); }
/** * 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 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(); }
/** * 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; }
/** * 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; }