Record Class ExportResult
java.lang.Object
java.lang.Record
codes.grow.packages.betterstack.logging.ExportResult
- Record Components:
accepted- records the service acceptedrejected- records the service rejectederror- the failure, when the export failed or partly failed
public record ExportResult(int accepted, int rejected, Optional<BetterStackException> error)
extends Record
Outcome of one
LogExporter.export(java.util.List<codes.grow.packages.betterstack.logging.LogRecord>, codes.grow.packages.betterstack.logging.ExportOptions) call. A partial acceptance is final (never retried).-
Constructor Summary
ConstructorsConstructorDescriptionExportResult(int accepted, int rejected, Optional<BetterStackException> error) Validates the result. -
Method Summary
Modifier and TypeMethodDescriptionintaccepted()Returns the value of theacceptedrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static ExportResultfailure(int accepted, int rejected, BetterStackException e) Some or all records failed.final inthashCode()Returns a hash code value for this object.intrejected()Returns the value of therejectedrecord component.static ExportResultsuccess(int accepted) All records accepted.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ExportResult
Validates the result.- Parameters:
accepted- records the service acceptedrejected- records the service rejectederror- the failure, when the export failed or partly failed
-
-
Method Details
-
success
All records accepted.- Parameters:
accepted- number of records- Returns:
- the result
-
failure
Some or all records failed.- Parameters:
accepted- records accepted before the failurerejected- records rejectede- the failure- Returns:
- the result
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
accepted
public int accepted()Returns the value of theacceptedrecord component.- Returns:
- the value of the
acceptedrecord component
-
rejected
public int rejected()Returns the value of therejectedrecord component.- Returns:
- the value of the
rejectedrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-