Class NamedStorage<T extends IName>

java.lang.Object
de.florianmichael.rclasses.pattern.storage.Storage<T>
de.florianmichael.rclasses.pattern.storage.named.NamedStorage<T>
Type Parameters:
T - The type of the objects that are stored in this storage.
Direct Known Subclasses:
SelectableNamedStorage

public abstract class NamedStorage<T extends IName> extends Storage<T>
Implementation of a named storage. This storage is used to store objects that implement the IName interface.
  • Constructor Details

    • NamedStorage

      public NamedStorage()
      Creates a new named storage with a CopyOnWriteArrayList.
    • NamedStorage

      public NamedStorage(Supplier<List<T>> list)
      Creates a new named storage with the given list.
      Parameters:
      list - The list.
  • Method Details

    • getByName

      public <V extends T> V getByName(String name)
      Gets an object by its name. see getByName(String, boolean) and IName for more information.
      Type Parameters:
      V - The type of the object.
      Parameters:
      name - The name.
      Returns:
      The object.
    • getByName

      public <V extends T> V getByName(String name, boolean ignoreCase)
      Gets an object by its name. see getByName(String) and IName for more information.
      Type Parameters:
      V - The type of the object.
      Parameters:
      name - The name.
      ignoreCase - Whether the case should be ignored.
      Returns:
      The object.