Record Class Emf.Options

java.lang.Object
java.lang.Record
codes.grow.packages.cloudwatchlogs.Emf.Options
Record Components:
namespace - metric namespace, 1–1024 characters (null: GrowSdk)
unit - CloudWatch unit (null: None)
timestamp - metric time (null: now)
properties - extra top-level properties (searchable fields that are not dimensions)
group - log group for emf() (null: config.logGroup)
stream - log stream for emf() (null: config.logStream)
Enclosing class:
Emf

public static record Emf.Options(String namespace, String unit, Instant timestamp, Map<String,Object> properties, String group, String stream) extends Record
  • Constructor Details

    • Options

      public Options(String namespace, String unit, Instant timestamp, Map<String,Object> properties, String group, String stream)
      Applies defaults.
      Parameters:
      namespace - namespace
      unit - unit
      timestamp - time
      properties - properties
      group - group
      stream - stream
  • Method Details

    • defaults

      public static Emf.Options defaults()
      Default options.
      Returns:
      the options
    • withNamespace

      public Emf.Options withNamespace(String value)
      Returns a copy with another namespace.
      Parameters:
      value - namespace
      Returns:
      the copy
    • withUnit

      public Emf.Options withUnit(String value)
      Returns a copy with another unit.
      Parameters:
      value - unit
      Returns:
      the copy
    • withTimestamp

      public Emf.Options withTimestamp(Instant value)
      Returns a copy with another timestamp.
      Parameters:
      value - time
      Returns:
      the copy
    • withProperties

      public Emf.Options withProperties(Map<String,Object> value)
      Returns a copy with other properties.
      Parameters:
      value - properties
      Returns:
      the copy
    • withTarget

      public Emf.Options withTarget(String groupName, String streamName)
      Returns a copy with another log group and stream.
      Parameters:
      groupName - log group (null: default)
      streamName - log stream (null: default)
      Returns:
      the copy
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • namespace

      public String namespace()
      Returns the value of the namespace record component.
      Returns:
      the value of the namespace record component
    • unit

      public String unit()
      Returns the value of the unit record component.
      Returns:
      the value of the unit record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • properties

      public Map<String,Object> properties()
      Returns the value of the properties record component.
      Returns:
      the value of the properties record component
    • group

      public String group()
      Returns the value of the group record component.
      Returns:
      the value of the group record component
    • stream

      public String stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component