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

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

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

origin: spring-projects/spring-data-jpa

  /**
   * Obtains all {@link Metamodel} instances of the current {@link ApplicationContext}.
   *
   * @return
   */
  private Set<Metamodel> getMetamodels() {

    if (beanFactory == null) {
      throw new IllegalStateException("BeanFactory must not be null!");
    }

    Collection<EntityManagerFactory> factories = BeanFactoryUtils
        .beansOfTypeIncludingAncestors(beanFactory, EntityManagerFactory.class).values();

    return factories.stream() //
        .map(EntityManagerFactory::getMetamodel) //
        .collect(StreamUtils.toUnmodifiableSet());
  }
}
origin: spring-projects/spring-data-jpa

/**
 * Creates a new {@link JpaMetamodel} for the given JPA {@link Metamodel}.
 *
 * @param metamodel must not be {@literal null}.
 */
private JpaMetamodel(Metamodel metamodel) {
  Assert.notNull(metamodel, "Metamodel must not be null!");
  this.metamodel = metamodel;
  this.managedTypes = Lazy.of(() -> metamodel.getManagedTypes().stream() //
      .map(ManagedType::getJavaType) //
      .filter(it -> it != null) //
      .collect(StreamUtils.toUnmodifiableSet()));
}
origin: spring-projects/spring-data-rest

/**
 * Returns an unmodifiable {@link Set} of all underlying {@link HttpMethod}s.
 * 
 * @return
 */
default Set<HttpMethod> toSet() {
  return stream().collect(StreamUtils.toUnmodifiableSet());
}
origin: apache/servicemix-bundles

  @Override
  public Set<MethodMetadata> getMethods(String name) {
    Assert.hasText(name, "Method name must not be null or empty");
    return methodMetadataSet.stream() //
        .filter(it -> it.getMethodName().equals(name)) //
        .collect(StreamUtils.toUnmodifiableSet());
  }
}
origin: org.springframework.data/spring-data-jpa

  /**
   * Obtains all {@link Metamodel} instances of the current {@link ApplicationContext}.
   *
   * @return
   */
  private Set<Metamodel> getMetamodels() {

    if (beanFactory == null) {
      throw new IllegalStateException("BeanFactory must not be null!");
    }

    Collection<EntityManagerFactory> factories = BeanFactoryUtils
        .beansOfTypeIncludingAncestors(beanFactory, EntityManagerFactory.class).values();

    return factories.stream() //
        .map(EntityManagerFactory::getMetamodel) //
        .collect(StreamUtils.toUnmodifiableSet());
  }
}
origin: org.springframework.data/spring-data-jpa

/**
 * Creates a new {@link JpaMetamodel} for the given JPA {@link Metamodel}.
 *
 * @param metamodel must not be {@literal null}.
 */
private JpaMetamodel(Metamodel metamodel) {
  Assert.notNull(metamodel, "Metamodel must not be null!");
  this.metamodel = metamodel;
  this.managedTypes = Lazy.of(() -> metamodel.getManagedTypes().stream() //
      .map(ManagedType::getJavaType) //
      .filter(it -> it != null) //
      .collect(StreamUtils.toUnmodifiableSet()));
}
origin: apache/servicemix-bundles

@Nonnull
@Override
public Set<ConvertiblePair> getConvertibleTypes() {
  return Streamable.of(wrapperTypes)//
      .map(it -> new ConvertiblePair(NullableWrapper.class, it))//
      .stream().collect(StreamUtils.toUnmodifiableSet());
}
origin: apache/servicemix-bundles

/**
 * Tries to detect a custom implementation for a repository bean by classpath scanning.
 *
 * @param lookup must not be {@literal null}.
 * @return the {@code AbstractBeanDefinition} of the custom implementation or {@literal null} if none found.
 */
public Optional<AbstractBeanDefinition> detectCustomImplementation(ImplementationLookupConfiguration lookup) {
  Assert.notNull(lookup, "ImplementationLookupConfiguration must not be null!");
  Set<BeanDefinition> definitions = implementationCandidates.getOptional()
      .orElseGet(() -> findCandidateBeanDefinitions(lookup)).stream() //
      .filter(lookup::matches) //
      .collect(StreamUtils.toUnmodifiableSet());
  return SelectionSet //
      .of(definitions, c -> c.isEmpty() ? Optional.empty() : throwAmbiguousCustomImplementationException(c)) //
      .filterIfNecessary(lookup::hasMatchingBeanName) //
      .uniqueResult() //
      .map(AbstractBeanDefinition.class::cast);
}
org.springframework.data.utilStreamUtilstoUnmodifiableSet

Javadoc

Returns a Collector to create an unmodifiable Set.

Popular methods of StreamUtils

  • toUnmodifiableList
  • createStreamFromIterator
  • 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 PhpStorm 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