/** * Gets an unmodifiable view of the order of the Set. * * @return an unmodifiable list view */ public List asList() { return UnmodifiableList.decorate(setOrder); }
/** * Gets the list of Iterators (unmodifiable). * * @return the unmodifiable list of iterators added */ public List getIterators() { return UnmodifiableList.decorate(iterators); }
/** * Get the list of Iterators (unmodifiable) * * @return the unmodifiable list of iterators added */ public List getIterators() { return UnmodifiableList.decorate(iteratorChain); }
/** * Returns an unmodifiable list backed by the given list. * <p> * This method uses the implementation in the decorators subpackage. * * @param list the list to make unmodifiable, must not be null * @return an unmodifiable list backed by the given list * @throws IllegalArgumentException if the list is null */ public static List unmodifiableList(List list) { return UnmodifiableList.decorate(list); }
/** * Gets a view over the keys in the map as a List. * <p> * The List will be ordered by object insertion into the map. * The List is unmodifiable. * * @see #keySet() * @return the unmodifiable list view over the keys * @since Commons Collections 3.2 */ public List keyList() { return UnmodifiableList.decorate(insertOrder); }
/** * Gets the list of Iterators (unmodifiable). * * @return the unmodifiable list of iterators added */ public List getIterators() { return UnmodifiableList.decorate(iterators); }
/** * Gets an unmodifiable view of the order of the Set. * * @return an unmodifiable list view */ public List asList() { return UnmodifiableList.decorate(setOrder); }
/** * Get the list of Iterators (unmodifiable) * * @return the unmodifiable list of iterators added */ public List getIterators() { return UnmodifiableList.decorate(iteratorChain); }
/** * Returns an unmodifiable list backed by the given list. * <p> * This method uses the implementation in the decorators subpackage. * * @param list the list to make unmodifiable, must not be null * @return an unmodifiable list backed by the given list * @throws IllegalArgumentException if the list is null */ public static List unmodifiableList(List list) { return UnmodifiableList.decorate(list); }
/** * Gets a view over the keys in the map as a List. * <p> * The List will be ordered by object insertion into the map. * The List is unmodifiable. * * @see #keySet() * @return the unmodifiable list view over the keys * @since Commons Collections 3.2 */ public List keyList() { return UnmodifiableList.decorate(insertOrder); }
/** * Gets the collections being decorated. * * @return Unmodifiable collection of all collections in this composite. */ public Collection getCollections() { return UnmodifiableList.decorate(Arrays.asList(this.all)); }
/** * Gets the collections being decorated. * * @return Unmodifiable collection of all collections in this composite. */ public Collection getCollections() { return UnmodifiableList.decorate(Arrays.asList(this.all)); }
/** * Returns the values for the BeanMap. * * @return values for the BeanMap. The returned collection is not * modifiable. */ public Collection values() { ArrayList answer = new ArrayList( readMethods.size() ); for ( Iterator iter = valueIterator(); iter.hasNext(); ) { answer.add( iter.next() ); } return UnmodifiableList.decorate(answer); }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
/** * Returns the values for the BeanMap. * * @return values for the BeanMap. The returned collection is not * modifiable. */ public Collection values() { ArrayList answer = new ArrayList( readMethods.size() ); for ( Iterator iter = valueIterator(); iter.hasNext(); ) { answer.add( iter.next() ); } return UnmodifiableList.decorate(answer); }
public List subList(int fromIndexInclusive, int toIndexExclusive) { return UnmodifiableList.decorate(super.subList(fromIndexInclusive, toIndexExclusive)); } }
public List makeEmptyList() { return UnmodifiableList.decorate(new ArrayList()); }
public List makeFullList() { ArrayList list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return UnmodifiableList.decorate(list); }
@Override public <K, V> Collection<ConsumerRecord<K, V>> getAllRecordsFromTopic(Properties properties, String topic, int partition, long timeout) { List<ConsumerRecord<K, V>> result = new ArrayList<>(); try (KafkaConsumer<K, V> consumer = new KafkaConsumer<>(properties)) { consumer.assign(Arrays.asList(new TopicPartition(topic, partition))); while (true) { boolean processedAtLeastOneRecord = false; Iterator<ConsumerRecord<K, V>> iterator = consumer.poll(timeout).iterator(); while (iterator.hasNext()) { ConsumerRecord<K, V> record = iterator.next(); result.add(record); processedAtLeastOneRecord = true; } if (!processedAtLeastOneRecord) { break; } } consumer.commitSync(); } return UnmodifiableList.decorate(result); }
@Override public <K, V> Collection<ConsumerRecord<K, V>> getAllRecordsFromTopic(Properties properties, String topic, int partition, long timeout) { List<ConsumerRecord<K, V>> result = new ArrayList<>(); try (KafkaConsumer<K, V> consumer = new KafkaConsumer<>(properties)) { consumer.assign(Arrays.asList(new TopicPartition(topic, partition))); while (true) { boolean processedAtLeastOneRecord = false; // wait for new records with timeout and break the loop if we didn't get any Iterator<ConsumerRecord<K, V>> iterator = consumer.poll(timeout).iterator(); while (iterator.hasNext()) { ConsumerRecord<K, V> record = iterator.next(); result.add(record); processedAtLeastOneRecord = true; } if (!processedAtLeastOneRecord) { break; } } consumer.commitSync(); } return UnmodifiableList.decorate(result); }