Tabnine Logo
StreamUtils.toUnmodifiableList
Code IndexAdd Tabnine to your IDE (free)

How to use
toUnmodifiableList
method
in
org.springframework.data.util.StreamUtils

Best Java code snippets using org.springframework.data.util.StreamUtils.toUnmodifiableList (Showing top 20 results out of 315)

origin: spring-projects/spring-data-mongodb

public static List<Object> toIds(Collection<Document> documents) {
  return documents.stream()//
      .map(it -> it.get(ID_FIELD))//
      .collect(StreamUtils.toUnmodifiableList());
}
origin: spring-projects/spring-data-jpa

private static Iterable<QueryParameterSetter> createSetters(List<ParameterBinding> parameterBindings,
    DeclaredQuery declaredQuery, QueryParameterSetterFactory... strategies) {
  return parameterBindings.stream() //
      .map(it -> createQueryParameterSetter(it, strategies, declaredQuery)) //
      .collect(StreamUtils.toUnmodifiableList());
}
origin: spring-projects/spring-data-mongodb

@Override
public <S extends T> List<S> insert(Iterable<S> entities) {
  Assert.notNull(entities, "The given Iterable of entities not be null!");
  List<S> list = Streamable.of(entities).stream().collect(StreamUtils.toUnmodifiableList());
  if (list.isEmpty()) {
    return list;
  }
  return new ArrayList<>(mongoOperations.insertAll(list));
}
origin: spring-projects/spring-data-mongodb

@Override
public <S extends T> Flux<S> insert(Iterable<S> entities) {
  Assert.notNull(entities, "The given Iterable of entities must not be null!");
  List<S> source = Streamable.of(entities).stream().collect(StreamUtils.toUnmodifiableList());
  return source.isEmpty() ? Flux.empty() : Flux.from(mongoOperations.insertAll(source));
}
origin: spring-projects/spring-data-mongodb

@Override
public Flux<T> findAllById(Iterable<ID> ids) {
  Assert.notNull(ids, "The given Iterable of Id's must not be null!");
  return findAll(new Query(new Criteria(entityInformation.getIdAttribute())
      .in(Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList()))));
}
origin: spring-projects/spring-data-mongodb

@Override
public Iterable<T> findAllById(Iterable<ID> ids) {
  return findAll(new Query(new Criteria(entityInformation.getIdAttribute())
      .in(Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList()))));
}
origin: org.springframework.data/spring-data-mongodb

public static List<Object> toIds(Collection<Document> documents) {
  return documents.stream()//
      .map(it -> it.get(ID_FIELD))//
      .collect(StreamUtils.toUnmodifiableList());
}
origin: spring-projects/spring-data-rest

/**
 * Returns the {@link EntityLookup}s registered on this configuration.
 *
 * @param repositories must not be {@literal null}.
 * @return
 */
public List<EntityLookup<?>> getEntityLookups(Repositories repositories) {
  Assert.notNull(repositories, "Repositories must not be null!");
  return lookupInformation.stream()//
      .map(it -> new RepositoriesEntityLookup<>(repositories, it))//
      .collect(StreamUtils.toUnmodifiableList());
}
origin: org.springframework.data/spring-data-mongodb

@Override
public <S extends T> List<S> insert(Iterable<S> entities) {
  Assert.notNull(entities, "The given Iterable of entities not be null!");
  List<S> list = Streamable.of(entities).stream().collect(StreamUtils.toUnmodifiableList());
  if (list.isEmpty()) {
    return list;
  }
  return new ArrayList<>(mongoOperations.insertAll(list));
}
origin: org.springframework.data/spring-data-mongodb

@Override
public <S extends T> Flux<S> insert(Iterable<S> entities) {
  Assert.notNull(entities, "The given Iterable of entities must not be null!");
  List<S> source = Streamable.of(entities).stream().collect(StreamUtils.toUnmodifiableList());
  return source.isEmpty() ? Flux.empty() : Flux.from(mongoOperations.insertAll(source));
}
origin: org.springframework.data/spring-data-mongodb

@Override
public Flux<T> findAllById(Iterable<ID> ids) {
  Assert.notNull(ids, "The given Iterable of Id's must not be null!");
  return findAll(new Query(new Criteria(entityInformation.getIdAttribute())
      .in(Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList()))));
}
origin: org.springframework.data/spring-data-mongodb

@Override
public Iterable<T> findAllById(Iterable<ID> ids) {
  return findAll(new Query(new Criteria(entityInformation.getIdAttribute())
      .in(Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList()))));
}
origin: slyak/spring-data-jpa-extra

private static Iterable<QueryParameterSetter> createSetters(List<StringQuery.ParameterBinding> parameterBindings,
                              DeclaredQuery declaredQuery, QueryParameterSetterFactory... strategies) {
  return parameterBindings.stream() //
      .map(it -> createQueryParameterSetter(it, strategies, declaredQuery)) //
      .collect(StreamUtils.toUnmodifiableList());
}
origin: apache/servicemix-bundles

/**
 * Creates a new {@link Revisions} instance using the given revisions.
 *
 * @param revisions must not be {@literal null}.
 * @param latestLast
 */
private Revisions(List<? extends Revision<N, T>> revisions, boolean latestLast) {
  Assert.notNull(revisions, "Revisions must not be null!");
  this.revisions = revisions.stream()//
      .sorted(latestLast ? NATURAL_ORDER : NATURAL_ORDER.reversed())//
      .collect(StreamUtils.toUnmodifiableList());
  this.latestLast = latestLast;
}
origin: org.springframework.data/spring-data-jpa

private static Iterable<QueryParameterSetter> createSetters(List<ParameterBinding> parameterBindings,
    DeclaredQuery declaredQuery, QueryParameterSetterFactory... strategies) {
  return parameterBindings.stream() //
      .map(it -> createQueryParameterSetter(it, strategies, declaredQuery)) //
      .collect(StreamUtils.toUnmodifiableList());
}
origin: apache/servicemix-bundles

/**
 * Returns {@link PropertyDescriptor}s for all properties exposed by the given type and all its super interfaces.
 *
 * @return
 */
List<PropertyDescriptor> getDescriptors() {
  return collectDescriptors().distinct().collect(StreamUtils.toUnmodifiableList());
}
origin: spring-projects/spring-data-envers

@SuppressWarnings("unchecked")
private List<Revision<N, T>> toRevisions(Map<N, T> source, Map<Number, Object> revisionEntities) {
  return source.entrySet().stream() //
      .map(entry -> Revision.of( //
          (RevisionMetadata<N>) getRevisionMetadata(revisionEntities.get(entry.getKey())), //
          entry.getValue())) //
      .sorted() //
      .collect(StreamUtils.toUnmodifiableList());
}
origin: org.springframework.data/spring-data-gemfire

@Override
public Collection<T> findAllById(Iterable<ID> ids) {
  List<ID> keys = Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList());
  return CollectionUtils.<ID, T>nullSafeMap(this.template.getAll(keys)).values().stream()
    .filter(Objects::nonNull).collect(Collectors.toList());
}
origin: org.springframework.data/spring-data-geode

@Override
public Collection<T> findAllById(Iterable<ID> ids) {
  List<ID> keys = Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList());
  return CollectionUtils.<ID, T>nullSafeMap(this.template.getAll(keys)).values().stream()
    .filter(Objects::nonNull).collect(Collectors.toList());
}
origin: org.springframework.data/spring-data-cassandra

@Override
public List<T> findAllById(Iterable<ID> ids) {
  Assert.notNull(ids, "The given Iterable of id's must not be null");
  List<ID> idCollection = Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList());
  return operations.select(Query.query(where(entityInformation.getIdAttribute()).in(idCollection)),
      entityInformation.getJavaType());
}
org.springframework.data.utilStreamUtilstoUnmodifiableList

Javadoc

Returns a Collector to create an unmodifiable List.

Popular methods of StreamUtils

  • createStreamFromIterator
  • toUnmodifiableSet
  • toMultiMap
    Returns a Collector to create a MultiValueMap.
  • zip
    Zips the given Streams using the given BiFunction. The resulting Stream will have the length of the

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now