Record Class ContentTransformResult

java.lang.Object
java.lang.Record
org.alfresco.elasticsearch.batchindexing.domain.transform.ContentTransformResult

public record ContentTransformResult(Optional<String> text, Optional<ContentTransformFailure> failure) extends Record
Outcome of a single ContentTransformClient.transformContent(Long) call. Three shapes:
  • ofText(String) — 200 OK with a non-empty body; index it.
  • empty() — 200 OK with an empty body. Documented as "no content" (not a failure); writer moves on and no DLQ entry is produced.
  • ofFailure(ContentTransformFailure) — non-retryable HTTP error (e.g. 4xx). Writer skips the item and forwards the failure to the optional DLQ bridge.
Transient 5xx / timeout retries are handled inside the client; they only surface here as an empty result once retries are exhausted, matching the pre-existing "best-effort secondary indexing" contract.
  • Constructor Details

    • ContentTransformResult

      public ContentTransformResult(Optional<String> text, Optional<ContentTransformFailure> failure)
      Creates an instance of a ContentTransformResult record class.
      Parameters:
      text - the value for the text record component
      failure - the value for the failure record component
  • Method Details

    • ofText

      public static ContentTransformResult ofText(String text)
    • empty

      public static ContentTransformResult empty()
    • ofFailure

      public static ContentTransformResult ofFailure(ContentTransformFailure failure)
    • 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.
    • text

      public Optional<String> text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • failure

      public Optional<ContentTransformFailure> failure()
      Returns the value of the failure record component.
      Returns:
      the value of the failure record component