Package dev.braintrust.eval
Record Class Classification
java.lang.Object
java.lang.Record
dev.braintrust.eval.Classification
- Record Components:
name- optional grouping key; defaults to the owning classifier's resolved name when null or blankid- stable identifier for the classification (required)label- optional display labelmetadata- optional arbitrary metadata
public record Classification(@Nullable String name, String id, @Nullable String label, @Nullable Map<String,Object> metadata)
extends Record
A single structured classification produced by a
Classifier.
Unlike a Score (numeric 0-1), a Classification carries a stable id, an optional
display label, and optional metadata. The name acts as the grouping key in the aggregated
result map; when name is null or blank, the owning classifier's resolved name is
used instead.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.label()Returns the value of thelabelrecord component.metadata()Returns the value of themetadatarecord component.name()Returns the value of thenamerecord component.static Classificationstatic Classificationstatic Classificationfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
-
of
-
of
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-