Class LogOptions

java.lang.Object
com.janboerman.invsee.spigot.api.logging.LogOptions
All Implemented Interfaces:
Cloneable

public class LogOptions extends Object implements Cloneable
Options for logging interactions with SpectatorInventoryViews.
See Also:
  • Field Details

  • Constructor Details

    • LogOptions

      public LogOptions()
  • Method Details

    • of

      @Deprecated public static LogOptions of(LogGranularity granularity, Set<LogTarget> logTargets)
      Deprecated.
    • of

      public static LogOptions of(LogGranularity granularity, Set<LogTarget> logTargets, EnumMap<LogTarget,String> formats)
      Create new logging options.
      Parameters:
      granularity - the granularity at which to log
      logTargets - where to log
      formats - in which formats to log
      Returns:
      the new logging options
    • isEmpty

      public static boolean isEmpty(LogOptions options)
      Get whether the logging options are effectively zero.
      Parameters:
      options - the logging options
      Returns:
      true if the logging options don't cause any logging, otherwise false
    • empty

      public static LogOptions empty()
      Create new no-op logging options.
      Returns:
      new logging options.
    • clone

      public LogOptions clone()
      Create a deep copy of these logging options.
      Overrides:
      clone in class Object
      Returns:
      a deep copy of these options
    • withGranularity

      public LogOptions withGranularity(LogGranularity granularity)
      Set the log granularity.
    • withLogTargets

      public LogOptions withLogTargets(Collection<LogTarget> logTargets)
      Set the log targets.
    • withFormats

      public LogOptions withFormats(Map<LogTarget,String> logFormats)
      Set the log formats.
    • getGranularity

      public LogGranularity getGranularity()
      Get the log granularity.
    • getTargets

      public Set<LogTarget> getTargets()
      Get the log targets.
    • getFormats

      public Map<LogTarget,String> getFormats()
      Get the log formats.
    • getFormat

      public String getFormat(LogTarget logTarget)
      Get the log format for a given log target.
    • defaultLogFormats

      public static EnumMap<LogTarget,String> defaultLogFormats()
      Get the default log formats.
      Returns:
      a new map instance.
    • 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