@Override public <T> ProtobufList<T> visitList(ProtobufList<T> mine, ProtobufList<T> other) { if (!mine.equals(other)) { throw NOT_EQUALS; } return mine; }
@Override public <T> ProtobufList<T> visitList(ProtobufList<T> mine, ProtobufList<T> other) { int size = mine.size(); int otherSize = other.size(); if (size > 0 && otherSize > 0) { if (!mine.isModifiable()) { mine = mine.mutableCopyWithCapacity(size + otherSize); } mine.addAll(other); } return size > 0 ? mine : other; }
protected static <E> ProtobufList<E> newProtobufList() { return new ProtobufArrayList<E>(); }
protected static <E> ProtobufList<E> newProtobufList(List<E> toCopy) { return new ProtobufArrayList<E>(toCopy); }
protected static <E> ProtobufList<E> emptyProtobufList() { return ProtobufArrayList.emptyList(); }
protected static <E> ProtobufList<E> mutableCopy(ProtobufList<E> list) { int size = list.size(); return list.mutableCopyWithCapacity( size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); }
@Override public <T> ProtobufList<T> visitList(ProtobufList<T> mine, ProtobufList<T> other) { hashCode = (53 * hashCode) + mine.hashCode(); return mine; }
<T> ProtobufList<T> visitList(ProtobufList<T> mine, ProtobufList<T> other);