Class TrackedError

java.lang.Object
io.github.projectunified.faststats.errortracker.TrackedError

public final class TrackedError extends Object
An error report with tracking metadata.
  • Constructor Details

    • TrackedError

      public TrackedError(Throwable error)
      Creates a new tracked error.
      Parameters:
      error - the error
  • Method Details

    • error

      public Throwable error()
      Returns the tracked error.
      Returns:
      the tracked error
    • handled

      public boolean handled()
      Returns whether the error was handled.
      Returns:
      whether the error was handled
    • handled

      public TrackedError handled(boolean handled)
      Sets whether the error was handled.
      Parameters:
      handled - whether the error was handled
      Returns:
      this tracked error
    • attributes

      public Map<String,Object> attributes()
      Returns a copy of the additional error attributes.
      Returns:
      a copy of the additional error attributes
    • attributes

      public TrackedError attributes(Map<String,Object> attributes)
      Sets the additional error attributes.
      Parameters:
      attributes - the additional error attributes
      Returns:
      this tracked error
    • attributes

      public TrackedError attributes(Consumer<Map<String,Object>> consumer)
      Modifies the additional error attributes using a consumer.
      Parameters:
      consumer - the consumer to modify attributes
      Returns:
      this tracked error
    • attributes

      public TrackedError attributes(Supplier<Map<String,Object>> supplier)
      Sets the additional error attributes using a supplier.
      Parameters:
      supplier - the supplier of attributes
      Returns:
      this tracked error
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object