Record Class MetricsBackendContext

java.lang.Object
java.lang.Record
com.monkey.ultimatebot.common.metrics.MetricsBackendContext

public record MetricsBackendContext(boolean prometheusEndpointEnabled, String pluginVersion, String minecraftVersion, IntSupplier activeBots, LongSupplier targetCacheSize, LongSupplier targetCacheHits, LongSupplier targetCacheMisses, LongSupplier targetCacheEvictions) extends Record
Immutable Java-only runtime values exposed to an optional metrics backend.
  • Constructor Details

    • MetricsBackendContext

      public MetricsBackendContext(boolean prometheusEndpointEnabled, String pluginVersion, String minecraftVersion, IntSupplier activeBots, LongSupplier targetCacheSize, LongSupplier targetCacheHits, LongSupplier targetCacheMisses, LongSupplier targetCacheEvictions)
      Creates an instance of a MetricsBackendContext record class.
      Parameters:
      prometheusEndpointEnabled - the value for the prometheusEndpointEnabled record component
      pluginVersion - the value for the pluginVersion record component
      minecraftVersion - the value for the minecraftVersion record component
      activeBots - the value for the activeBots record component
      targetCacheSize - the value for the targetCacheSize record component
      targetCacheHits - the value for the targetCacheHits record component
      targetCacheMisses - the value for the targetCacheMisses record component
      targetCacheEvictions - the value for the targetCacheEvictions record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • prometheusEndpointEnabled

      public boolean prometheusEndpointEnabled()
      Returns the value of the prometheusEndpointEnabled record component.
      Returns:
      the value of the prometheusEndpointEnabled record component
    • pluginVersion

      public String pluginVersion()
      Returns the value of the pluginVersion record component.
      Returns:
      the value of the pluginVersion record component
    • minecraftVersion

      public String minecraftVersion()
      Returns the value of the minecraftVersion record component.
      Returns:
      the value of the minecraftVersion record component
    • activeBots

      public IntSupplier activeBots()
      Returns the value of the activeBots record component.
      Returns:
      the value of the activeBots record component
    • targetCacheSize

      public LongSupplier targetCacheSize()
      Returns the value of the targetCacheSize record component.
      Returns:
      the value of the targetCacheSize record component
    • targetCacheHits

      public LongSupplier targetCacheHits()
      Returns the value of the targetCacheHits record component.
      Returns:
      the value of the targetCacheHits record component
    • targetCacheMisses

      public LongSupplier targetCacheMisses()
      Returns the value of the targetCacheMisses record component.
      Returns:
      the value of the targetCacheMisses record component
    • targetCacheEvictions

      public LongSupplier targetCacheEvictions()
      Returns the value of the targetCacheEvictions record component.
      Returns:
      the value of the targetCacheEvictions record component