@Override public List<FieldError> getFieldErrors() { List<FieldError> result = new LinkedList<>(); for (ObjectError objectError : this.errors) { if (objectError instanceof FieldError) { result.add((FieldError) objectError); } } return Collections.unmodifiableList(result); }
@Override public List<IContainer> getBranches() { List<IContainer> branches = new ArrayList<>(cases.size() + 1); branches.addAll(cases); branches.add(defCase); return Collections.unmodifiableList(branches); }
private List<String> getEndpoints(String keyspace, TokenRange tokenRange) { Set<Host> endpoints = session.getReplicas(keyspace, tokenRange); return unmodifiableList(endpoints.stream() .map(Host::toString) .collect(toList())); }
mutable_bitField0_ |= 0x00000001; beforeColumns_.add(input.readMessage(Column.PARSER, extensionRegistry)); break; mutable_bitField0_ |= 0x00000002; afterColumns_.add(input.readMessage(Column.PARSER, extensionRegistry)); break; mutable_bitField0_ |= 0x00000004; props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); afterColumns_ = java.util.Collections.unmodifiableList(afterColumns_); props_ = java.util.Collections.unmodifiableList(props_);
public static Iterable<List<Object>> fixData(List<Column> columns, Iterable<List<Object>> data) { if (data == null) { return null; } requireNonNull(columns, "columns is null"); List<TypeSignature> signatures = columns.stream() .map(column -> parseTypeSignature(column.getType())) .collect(toList()); ImmutableList.Builder<List<Object>> rows = ImmutableList.builder(); for (List<Object> row : data) { checkArgument(row.size() == columns.size(), "row/column size mismatch"); List<Object> newRow = new ArrayList<>(); for (int i = 0; i < row.size(); i++) { newRow.add(fixValue(signatures.get(i), row.get(i))); } rows.add(unmodifiableList(newRow)); // allow nulls in list } return rows.build(); }
/** * Get the list of all values that are members of this cache. Does not * affect the access time used for eviction. */ public List<V> values() { final Collection<Entry<V>> values = map.values(); // Note below that e.value avoids updating the access time final List<V> res = values.stream().map(e -> e.value).collect(Collectors.toList()); return Collections.unmodifiableList(res); }
private ComputedStatistics( List<String> groupingColumns, List<Block> groupingValues, Map<TableStatisticType, Block> tableStatistics, Map<ColumnStatisticMetadata, Block> columnStatistics) { this.groupingColumns = unmodifiableList(new ArrayList<>(requireNonNull(groupingColumns, "groupingColumns is null"))); this.groupingValues = unmodifiableList(new ArrayList<>(requireNonNull(groupingValues, "groupingValues is null"))); if (!groupingValues.stream().allMatch(ComputedStatistics::isSingleValueBlock)) { throw new IllegalArgumentException("grouping value blocks are expected to be single value blocks"); } this.tableStatistics = unmodifiableMap(new HashMap<>(requireNonNull(tableStatistics, "tableStatistics is null"))); if (!tableStatistics.values().stream().allMatch(ComputedStatistics::isSingleValueBlock)) { throw new IllegalArgumentException("computed table statistics blocks are expected to be single value blocks"); } this.columnStatistics = unmodifiableMap(new HashMap<>(requireNonNull(columnStatistics, "columnStatistics is null"))); if (!columnStatistics.values().stream().allMatch(ComputedStatistics::isSingleValueBlock)) { throw new IllegalArgumentException("computed column statistics blocks are expected to be single value blocks"); } }
boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: mutable_bitField0_ |= 0x00000002; messages_.add(input.readBytes()); break; throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { messages_ = java.util.Collections.unmodifiableList(messages_);
@Override public List<ObjectError> getGlobalErrors() { List<ObjectError> result = new LinkedList<>(); for (ObjectError objectError : this.errors) { if (!(objectError instanceof FieldError)) { result.add(objectError); } } return Collections.unmodifiableList(result); }
@Override public List<IContainer> getSubBlocks() { List<IContainer> all = new ArrayList<>(cases.size() + 2); all.add(header); all.addAll(cases); if (defCase != null) { all.add(defCase); } return Collections.unmodifiableList(all); }
public List<Flow> flows() { return this.flows.stream() .<Flow>map(l -> () -> unmodifiableList(new ArrayList<>(l))) .collect(toList()); }
public static Iterable<List<Object>> fixData(List<Column> columns, Iterable<List<Object>> data) { if (data == null) { return null; } requireNonNull(columns, "columns is null"); List<TypeSignature> signatures = columns.stream() .map(column -> parseTypeSignature(column.getType())) .collect(toList()); ImmutableList.Builder<List<Object>> rows = ImmutableList.builder(); for (List<Object> row : data) { checkArgument(row.size() == columns.size(), "row/column size mismatch"); List<Object> newRow = new ArrayList<>(); for (int i = 0; i < row.size(); i++) { newRow.add(fixValue(signatures.get(i), row.get(i))); } rows.add(unmodifiableList(newRow)); // allow nulls in list } return rows.build(); }
public List<String> getLeaves() { return unmodifiableList(relations.values() .stream() .filter(qualifier -> relations.get(qualifier).isEmpty()) .collect(Collectors.toList())); }
private ComputedStatistics( List<String> groupingColumns, List<Block> groupingValues, Map<TableStatisticType, Block> tableStatistics, Map<ColumnStatisticMetadata, Block> columnStatistics) { this.groupingColumns = unmodifiableList(new ArrayList<>(requireNonNull(groupingColumns, "groupingColumns is null"))); this.groupingValues = unmodifiableList(new ArrayList<>(requireNonNull(groupingValues, "groupingValues is null"))); if (!groupingValues.stream().allMatch(ComputedStatistics::isSingleValueBlock)) { throw new IllegalArgumentException("grouping value blocks are expected to be single value blocks"); } this.tableStatistics = unmodifiableMap(new HashMap<>(requireNonNull(tableStatistics, "tableStatistics is null"))); if (!tableStatistics.values().stream().allMatch(ComputedStatistics::isSingleValueBlock)) { throw new IllegalArgumentException("computed table statistics blocks are expected to be single value blocks"); } this.columnStatistics = unmodifiableMap(new HashMap<>(requireNonNull(columnStatistics, "columnStatistics is null"))); if (!columnStatistics.values().stream().allMatch(ComputedStatistics::isSingleValueBlock)) { throw new IllegalArgumentException("computed column statistics blocks are expected to be single value blocks"); } }
boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: mutable_bitField0_ |= 0x00000004; props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { props_ = java.util.Collections.unmodifiableList(props_);
public List<String> getStringValues() { List<String> stringList = new ArrayList<>(this.values.size()); for (Object value : this.values) { stringList.add(value.toString()); } return Collections.unmodifiableList(stringList); }
/** Returns a snapshot of the calls currently being executed. */ public synchronized List<Call> runningCalls() { List<Call> result = new ArrayList<>(); result.addAll(runningSyncCalls); for (AsyncCall asyncCall : runningAsyncCalls) { result.add(asyncCall.get()); } return Collections.unmodifiableList(result); }
@Override public void open(Map<String, Object> conf, TopologyContext context, SpoutOutputCollector collector) { streams = Collections.unmodifiableList(streamStats.stream() .map((ss) -> new OutputStreamEngineWithHisto(ss, context)).collect(Collectors.toList())); this.collector = collector; }
@SafeVarargs public ServletContextInitializerBeans(ListableBeanFactory beanFactory, Class<? extends ServletContextInitializer>... initializerTypes) { this.initializers = new LinkedMultiValueMap<>(); this.initializerTypes = (initializerTypes.length != 0) ? Arrays.asList(initializerTypes) : Collections.singletonList(ServletContextInitializer.class); addServletContextInitializerBeans(beanFactory); addAdaptableBeans(beanFactory); List<ServletContextInitializer> sortedInitializers = this.initializers.values() .stream() .flatMap((value) -> value.stream() .sorted(AnnotationAwareOrderComparator.INSTANCE)) .collect(Collectors.toList()); this.sortedList = Collections.unmodifiableList(sortedInitializers); logMappings(this.initializers); }
boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: mutable_bitField0_ |= 0x00000004; props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { props_ = java.util.Collections.unmodifiableList(props_);