Interface NamedCacheView<T>

Type Parameters:
T - Type of the entity held by this cache.
All Superinterfaces:
CacheView<T>, Iterable<T>
All Known Subinterfaces:
MutableNamedCacheView<T>
All Known Implementing Classes:
CompositeNamedCacheView, DefaultNamedCacheView, NoopCacheView

public interface NamedCacheView<T> extends CacheView<T>
A CacheView that provides utilities for finding elements based on their name.
Since:
12/15/18
Author:
natanbc
  • Method Details

    • findByName

      @Nonnull Collection<T> findByName(@Nonnull String name, boolean ignoreCase)
      Finds all entities with a name equal to the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      Returns:
      All elements that have a name equal to the provided.
      See Also:
    • findByName

      @Nonnull default Collection<T> findByName(@Nonnull String name)
      Finds all entities with a name equal to the provided value.
      Parameters:
      name - Name to search for.
      Returns:
      All elements that have a name equal to the provided.
      See Also:
    • findByName

      @Nonnull <C extends Collection<T>> C findByName(@Nonnull String name, boolean ignoreCase, @Nonnull Supplier<C> supplier)
      Finds all entities with a name equal to the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByName

      @Nonnull default <C extends Collection<T>> C findByName(@Nonnull String name, @Nonnull Supplier<C> supplier)
      Finds all entities with a name equal to the provided value.
      Parameters:
      name - Name to search for.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByNameContains

      @Nonnull Collection<T> findByNameContains(@Nonnull String name, boolean ignoreCase)
      Finds all entities whose name contains the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      Returns:
      All elements that have a name containing the provided.
      See Also:
    • findByNameContains

      @Nonnull default Collection<T> findByNameContains(@Nonnull String name)
      Finds all entities whose name contains the provided value.
      Parameters:
      name - Name to search for.
      Returns:
      All elements that have a name containing the provided.
      See Also:
    • findByNameContains

      @Nonnull <C extends Collection<T>> C findByNameContains(@Nonnull String name, boolean ignoreCase, @Nonnull Supplier<C> supplier)
      Finds all entities whose name contains the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByNameContains

      @Nonnull default <C extends Collection<T>> C findByNameContains(@Nonnull String name, @Nonnull Supplier<C> supplier)
      Finds all entities whose name contains the provided value.
      Parameters:
      name - Name to search for.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByNameStartsWith

      @Nonnull Collection<T> findByNameStartsWith(@Nonnull String name, boolean ignoreCase)
      Finds all entities whose name starts with the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      Returns:
      All elements that have a name starting with the provided.
      See Also:
    • findByNameStartsWith

      @Nonnull default Collection<T> findByNameStartsWith(@Nonnull String name)
      Finds all entities whose name starts with the provided value.
      Parameters:
      name - Name to search for.
      Returns:
      All elements that have a name starting with the provided.
      See Also:
    • findByNameStartsWith

      @Nonnull <C extends Collection<T>> C findByNameStartsWith(@Nonnull String name, boolean ignoreCase, @Nonnull Supplier<C> supplier)
      Finds all entities whose name starts with the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByNameStartsWith

      @Nonnull default <C extends Collection<T>> C findByNameStartsWith(@Nonnull String name, @Nonnull Supplier<C> supplier)
      Finds all entities whose name starts with the provided value.
      Parameters:
      name - Name to search for.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByNameEndsWith

      @Nonnull Collection<T> findByNameEndsWith(@Nonnull String name, boolean ignoreCase)
      Finds all entities whose name ends with the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      Returns:
      All elements that have a name ending with the provided.
      See Also:
    • findByNameEndsWith

      @Nonnull default Collection<T> findByNameEndsWith(@Nonnull String name)
      Finds all entities whose name ends with the provided value.
      Parameters:
      name - Name to search for.
      Returns:
      All elements that have a name ending with the provided.
      See Also:
    • findByNameEndsWith

      @Nonnull <C extends Collection<T>> C findByNameEndsWith(@Nonnull String name, boolean ignoreCase, @Nonnull Supplier<C> supplier)
      Finds all entities whose name ends with the provided value.
      Parameters:
      name - Name to search for.
      ignoreCase - Ignore casing differences between the entity names and the provided name.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also:
    • findByNameEndsWith

      @Nonnull default <C extends Collection<T>> C findByNameEndsWith(@Nonnull String name, @Nonnull Supplier<C> supplier)
      Finds all entities whose name ends with the provided value.
      Parameters:
      name - Name to search for.
      supplier - Supplier for the collection to add the elements to. The returned collection must be mutable.
      Returns:
      The collection returned by supplier, after adding the matching elements. May be empty.
      See Also: