Object
Found<T>
Type Parameters:
T - the object-type that may be found.
All Implemented Interfaces:
Findable<T>

public final class Found<T> extends Object implements Findable<T>
A positive-result when an object is found at a particular location.
Author:
Owen Feehan
  • Constructor Details

    • Found

      public Found(T object)
      Creates a new Found instance.
      Parameters:
      object - The found object.
  • Method Details

    • getOrLog

      public Optional<T> getOrLog(String name, Logger logger)
      Description copied from interface: Findable
      Gets an object or otherwise logs a message describing what went wrong.
      Specified by:
      getOrLog in interface Findable<T>
      Parameters:
      name - the name of the object to find, as may appear in the log.
      logger - the logger.
      Returns:
      the object if found, otherwise Optional.empty().
    • getObject

      public T getObject()
      The found object.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object