Package com.mewna.catnip.cache.view
Interface NamedCacheView<T>
- Type Parameters:
T
- Type of the entity held by this cache.
- All Known Subinterfaces:
MutableNamedCacheView<T>
- All Known Implementing Classes:
CompositeNamedCacheView
,DefaultNamedCacheView
,NoopCacheView
A
CacheView
that provides utilities for finding
elements based on their name.- Since:
- 12/15/18
- Author:
- natanbc
-
Method Summary
Modifier and TypeMethodDescriptiondefault Collection<T>
findByName
(String name) Finds all entities with a name equal to the provided value.findByName
(String name, boolean ignoreCase) Finds all entities with a name equal to the provided value.<C extends Collection<T>>
CfindByName
(String name, boolean ignoreCase, Supplier<C> supplier) Finds all entities with a name equal to the provided value.default <C extends Collection<T>>
CfindByName
(String name, Supplier<C> supplier) Finds all entities with a name equal to the provided value.default Collection<T>
findByNameContains
(String name) Finds all entities whose name contains the provided value.findByNameContains
(String name, boolean ignoreCase) Finds all entities whose name contains the provided value.<C extends Collection<T>>
CfindByNameContains
(String name, boolean ignoreCase, Supplier<C> supplier) Finds all entities whose name contains the provided value.default <C extends Collection<T>>
CfindByNameContains
(String name, Supplier<C> supplier) Finds all entities whose name contains the provided value.default Collection<T>
findByNameEndsWith
(String name) Finds all entities whose name ends with the provided value.findByNameEndsWith
(String name, boolean ignoreCase) Finds all entities whose name ends with the provided value.<C extends Collection<T>>
CfindByNameEndsWith
(String name, boolean ignoreCase, Supplier<C> supplier) Finds all entities whose name ends with the provided value.default <C extends Collection<T>>
CfindByNameEndsWith
(String name, Supplier<C> supplier) Finds all entities whose name ends with the provided value.default Collection<T>
findByNameStartsWith
(String name) Finds all entities whose name starts with the provided value.findByNameStartsWith
(String name, boolean ignoreCase) Finds all entities whose name starts with the provided value.<C extends Collection<T>>
CfindByNameStartsWith
(String name, boolean ignoreCase, Supplier<C> supplier) Finds all entities whose name starts with the provided value.default <C extends Collection<T>>
CfindByNameStartsWith
(String name, Supplier<C> supplier) Finds all entities whose name starts with the provided value.
-
Method Details
-
findByName
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
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
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
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
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
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
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
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:
-