Freigeben über


ContentSource Class

  • java.lang.Object
    • com.azure.ai.contentunderstanding.models.ContentSource

public abstract class ContentSource

Abstract base class for parsed grounding sources returned by Content Understanding.

The service encodes source positions as compact strings in the getSources() property. This class hierarchy parses those strings into strongly-typed objects:

Use parse(String source) or parse(String source) to parse a semicolon-delimited string containing one or more segments.

Constructor Summary

Modifier Constructor Description
protected ContentSource(String rawValue)

Initializes a new instance of ContentSource.

Method Summary

Modifier and Type Method and Description
boolean equals(Object obj)
String getRawValue()

Gets the original wire-format source string.

int hashCode()
static List<ContentSource> parseAll(String source)

Parses a semicolon-delimited string containing one or more source segments.

static String toRawString(List<? extends ContentSource> sources)

Reconstructs the wire-format source string by joining each element's getRawValue() with semicolons.

String toString()

Returns the wire-format string representation of this source.

Methods inherited from java.lang.Object

Constructor Details

ContentSource

protected ContentSource(String rawValue)

Initializes a new instance of ContentSource.

Parameters:

rawValue - The raw wire-format source string.

Method Details

equals

public boolean equals(Object obj)

Overrides:

ContentSource.equals(Object obj)

Parameters:

obj

getRawValue

public String getRawValue()

Gets the original wire-format source string.

Returns:

The raw source string.

hashCode

public int hashCode()

Overrides:

ContentSource.hashCode()

parseAll

public static List<ContentSource> parseAll(String source)

Parses a semicolon-delimited string containing one or more source segments.

Each segment is parsed individually, detecting the source type automatically.

Parameters:

source - The source string (may contain ; delimiters).

Returns:

An unmodifiable list of ContentSource instances.

toRawString

public static String toRawString(List<? extends ContentSource> sources)

Reconstructs the wire-format source string by joining each element's getRawValue() with semicolons.

Parameters:

sources - The content source list.

Returns:

A semicolon-delimited string of raw source values.

toString

public String toString()

Returns the wire-format string representation of this source.

Overrides:

ContentSource.toString()

Returns:

The raw source string.

Applies to