public class UnmodifiableLazyStringList extends AbstractList<String> implements LazyStringList, RandomAccess
Inheritance
Object >
java.util.AbstractCollection >
AbstractList >
UnmodifiableLazyStringList
Constructors
UnmodifiableLazyStringList(LazyStringList list)
public UnmodifiableLazyStringList(LazyStringList list)
Methods
add(byte[] element)
public void add(byte[] element)
Appends the specified element to the end of this list (optional operation).
Parameter |
---|
Name | Description |
element | byte[]
|
add(ByteString element)
public void add(ByteString element)
Appends the specified element to the end of this list (optional operation).
addAllByteArray(Collection<byte[]> element)
public boolean addAllByteArray(Collection<byte[]> element)
Appends all elements in the specified byte[] collection to the end of this list.
addAllByteString(Collection<? extends ByteString> element)
public boolean addAllByteString(Collection<? extends ByteString> element)
Appends all elements in the specified ByteString collection to the end of this list.
Parameter |
---|
Name | Description |
element | Collection<? extends com.google.protobuf.ByteString>
|
asByteArrayList()
public List<byte[]> asByteArrayList()
Returns a mutable view of this list. Changes to the view will be made into the original list.
This method is used in mutable API only.
asByteStringList()
public List<ByteString> asByteStringList()
Returns a view of the data as a list of ByteStrings.
get(int index)
public String get(int index)
Parameter |
---|
Name | Description |
index | int
|
Overrides
getByteArray(int index)
public byte[] getByteArray(int index)
Returns the element at the specified position in this list as byte[].
Parameter |
---|
Name | Description |
index | int
|
Returns |
---|
Type | Description |
byte[] | |
getByteString(int index)
public ByteString getByteString(int index)
Returns the element at the specified position in this list as a ByteString.
Parameter |
---|
Name | Description |
index | int
|
getRaw(int index)
public Object getRaw(int index)
Returns the element at the specified position in this list as an Object that will either be a
String or a ByteString.
Parameter |
---|
Name | Description |
index | int
|
getUnderlyingElements()
public List<?> getUnderlyingElements()
Returns an unmodifiable List of the underlying elements, each of which is either a
String
or its equivalent UTF-8 encoded ByteString
or byte[]. It is an error for the
caller to modify the returned List, and attempting to do so will result in an UnsupportedOperationException.
Returns |
---|
Type | Description |
List<?> | |
getUnmodifiableView()
public LazyStringList getUnmodifiableView()
Returns an unmodifiable view of the list.
iterator()
public Iterator<String> iterator()
Overrides
listIterator(int index)
public ListIterator<String> listIterator(int index)
Parameter |
---|
Name | Description |
index | int
|
Overrides
mergeFrom(LazyStringList other)
public void mergeFrom(LazyStringList other)
Merges all elements from another LazyStringList into this one. This method differs from #addAll(Collection) on that underlying byte arrays are copied instead of reference shared.
Immutable API doesn't need to use this method as byte[] is not used there at all.
set(int index, byte[] element)
public void set(int index, byte[] element)
Replaces the element at the specified position in this list with the specified element
(optional operation).
Parameters |
---|
Name | Description |
index | int
|
element | byte[]
|
set(int index, ByteString element)
public void set(int index, ByteString element)
Replaces the element at the specified position in this list with the specified element
(optional operation).
size()
Returns |
---|
Type | Description |
int | |
Overrides