Class UnmodifiableLazyStringList (3.19.4)
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
|
| Returns |
| Type |
Description |
String |
|
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
|
| Returns |
| Type |
Description |
Object |
|
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]