Class Segment

  • All Implemented Interfaces:

    
    public abstract class Segment
    extends JsonSerializable
                        

    Segment of the content this support belongs to.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public abstract class Segment.Builder

      Builder for Segment.

    • Constructor Summary

      Constructors 
      Constructor Description
      Segment()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Optional<Integer> startIndex() Output only.
      abstract Optional<Integer> endIndex() Output only.
      abstract Optional<Integer> partIndex() Output only.
      abstract Optional<String> text() Output only.
      static Segment.Builder builder() Instantiates a builder for Segment.
      abstract Segment.Builder toBuilder() Creates a builder with the same values as this instance.
      static Segment fromJson(String jsonString) Deserializes a JSON string to a Segment object.
      • Methods inherited from class com.google.genai.JsonSerializable

        fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Segment

        Segment()
    • Method Detail

      • startIndex

         abstract Optional<Integer> startIndex()

        Output only. Start index in the given Part, measured in bytes.

        Offset from the start of the Part, inclusive, starting at zero.

      • endIndex

         abstract Optional<Integer> endIndex()

        Output only. End index in the given Part, measured in bytes.

        Offset from the start of the Part, exclusive, starting at zero.

      • partIndex

         abstract Optional<Integer> partIndex()

        Output only. The index of a Part object within its parent Content object.

      • text

         abstract Optional<String> text()

        Output only. The text corresponding to the segment from the response.