Class CacheControl
java.lang.Object
com.sap.ai.sdk.orchestration.model.CacheControl
Cache control directive for Anthropic prompt caching. Only applicable to Anthropic Claude models.
When set, marks the content block as a cache breakpoint.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static enumTime-to-live for the cache entry.static enumGets or Sets type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CacheControl.Buildercreate()Create a type-safe, fluent-api builder object to construct a newCacheControlinstance with all required arguments.booleangetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theCacheControl.getTtl()Time-to-live for the cache entry.getType()Get typeinthashCode()voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisCacheControlinstance.voidSet the ttl of thisCacheControlinstance.voidsetType(CacheControl.TypeEnum type) Set the type of thisCacheControlinstance.toMap()Get the value of all properties of thisCacheControlinstance including unrecognized properties.toString()ttl(CacheControl.TtlEnum ttl) Set the ttl of thisCacheControlinstance and return the same instance.type(CacheControl.TypeEnum type) Set the type of thisCacheControlinstance and return the same instance.
-
Constructor Details
-
CacheControl
protected CacheControl()Default constructor for CacheControl.
-
-
Method Details
-
type
Set the type of thisCacheControlinstance and return the same instance.- Parameters:
type- The type of thisCacheControl- Returns:
- The same instance of this
CacheControlclass
-
getType
Get type- Returns:
- type The type of this
CacheControlinstance.
-
setType
Set the type of thisCacheControlinstance.- Parameters:
type- The type of thisCacheControl
-
ttl
Set the ttl of thisCacheControlinstance and return the same instance.- Parameters:
ttl- Time-to-live for the cache entry. Default is \"5m\" (5 minutes). \"1h\" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5).- Returns:
- The same instance of this
CacheControlclass
-
getTtl
Time-to-live for the cache entry. Default is \"5m\" (5 minutes). \"1h\" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5).- Returns:
- ttl The ttl of this
CacheControlinstance.
-
setTtl
Set the ttl of thisCacheControlinstance.- Parameters:
ttl- Time-to-live for the cache entry. Default is \"5m\" (5 minutes). \"1h\" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5).
-
getCustomFieldNames
Get the names of the unrecognizable properties of theCacheControl.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisCacheControlinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisCacheControlinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisCacheControlinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Create a type-safe, fluent-api builder object to construct a newCacheControlinstance with all required arguments.
-
toMap()instead.