Class TrckMetric

java.lang.Object
com.sap.ai.sdk.core.model.TrckMetric

public class TrckMetric extends Object
Key-value metrics, where the value is numeric. Metric can also have optional step and label fields.
  • Constructor Details

    • TrckMetric

      protected TrckMetric()
      Default constructor for TrckMetric.
  • Method Details

    • name

      @Nonnull public TrckMetric name(@Nonnull String name)
      Set the name of this TrckMetric instance and return the same instance.
      Parameters:
      name - Name of the metric
      Returns:
      The same instance of this TrckMetric class
    • getName

      @Nonnull public String getName()
      Name of the metric
      Returns:
      name The name of this TrckMetric instance.
    • setName

      public void setName(@Nonnull String name)
      Set the name of this TrckMetric instance.
      Parameters:
      name - Name of the metric
    • value

      @Nonnull public TrckMetric value(@Nonnull BigDecimal value)
      Set the value of this TrckMetric instance and return the same instance.
      Parameters:
      value - Numeric Value of the metric
      Returns:
      The same instance of this TrckMetric class
    • getValue

      @Nonnull public BigDecimal getValue()
      Numeric Value of the metric
      Returns:
      value The value of this TrckMetric instance.
    • setValue

      public void setValue(@Nonnull BigDecimal value)
      Set the value of this TrckMetric instance.
      Parameters:
      value - Numeric Value of the metric
    • timestamp

      @Nonnull public TrckMetric timestamp(@Nullable OffsetDateTime timestamp)
      Set the timestamp of this TrckMetric instance and return the same instance.
      Parameters:
      timestamp - Time when the metric was created or logged in RFC3339 format
      Returns:
      The same instance of this TrckMetric class
    • getTimestamp

      @Nonnull public OffsetDateTime getTimestamp()
      Time when the metric was created or logged in RFC3339 format
      Returns:
      timestamp The timestamp of this TrckMetric instance.
    • setTimestamp

      public void setTimestamp(@Nullable OffsetDateTime timestamp)
      Set the timestamp of this TrckMetric instance.
      Parameters:
      timestamp - Time when the metric was created or logged in RFC3339 format
    • step

      @Nonnull public TrckMetric step(@Nullable Integer step)
      Set the step of this TrckMetric instance and return the same instance.
      Parameters:
      step - step is an optional integer that represents any measurement of training progress (number of training iterations, number of epochs, and so on) for the metric Minimum: 0
      Returns:
      The same instance of this TrckMetric class
    • getStep

      @Nonnull public Integer getStep()
      step is an optional integer that represents any measurement of training progress (number of training iterations, number of epochs, and so on) for the metric minimum: 0
      Returns:
      step The step of this TrckMetric instance.
    • setStep

      public void setStep(@Nullable Integer step)
      Set the step of this TrckMetric instance.
      Parameters:
      step - step is an optional integer that represents any measurement of training progress (number of training iterations, number of epochs, and so on) for the metric Minimum: 0
    • labels

      @Nonnull public TrckMetric labels(@Nullable List<TrckLabel> labels)
      Set the labels of this TrckMetric instance and return the same instance.
      Parameters:
      labels - a list of name-value object pairs associated with some metric.
      Returns:
      The same instance of this TrckMetric class
    • addLabelsItem

      @Nonnull public TrckMetric addLabelsItem(@Nonnull TrckLabel labelsItem)
      Add one labels instance to this TrckMetric.
      Parameters:
      labelsItem - The labels that should be added
      Returns:
      The same instance of type TrckMetric
    • getLabels

      @Nonnull public List<TrckLabel> getLabels()
      a list of name-value object pairs associated with some metric.
      Returns:
      labels The labels of this TrckMetric instance.
    • setLabels

      public void setLabels(@Nullable List<TrckLabel> labels)
      Set the labels of this TrckMetric instance.
      Parameters:
      labels - a list of name-value object pairs associated with some metric.
    • getCustomFieldNames

      @Nonnull public Set<String> getCustomFieldNames()
      Get the names of the unrecognizable properties of the TrckMetric.
      Returns:
      The set of properties names
    • getCustomField

      @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
      Deprecated.
      Use toMap() instead.
      Get the value of an unrecognizable property of this TrckMetric instance.
      Parameters:
      name - The name of the property
      Returns:
      The value of the property
      Throws:
      NoSuchElementException - If no property with the given name could be found.
    • toMap

      @Nonnull public Map<String,Object> toMap()
      Get the value of all properties of this TrckMetric instance including unrecognized properties.
      Returns:
      The map of all properties
    • setCustomField

      public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
      Set an unrecognizable property of this TrckMetric instance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
      Parameters:
      customFieldName - The name of the property
      customFieldValue - The value of the property
    • equals

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

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

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • create

      public static TrckMetric.Builder create()
      Create a type-safe, fluent-api builder object to construct a new TrckMetric instance with all required arguments.