Record Class: AdkWebCorsProperties
java.lang.Object
java.lang.Record
com.google.adk.web.config.AdkWebCorsProperties
@ConfigurationProperties(prefix="adk.web.cors")
public record AdkWebCorsProperties(String mapping, List<String> origins, List<String> methods, List<String> headers, boolean allowCredentials, long maxAge)
extends Record
用于在 ADK Web 中配置 CORS 的属性。该类用于从应用程序属性中加载 CORS 设置。
origins 默认值为空列表,因此仅允许来自相同源(same-origin)的请求。-
构造函数概述
Constructors -
方法概述
Modifier and TypeMethodDescriptionboolean返回该值的值。allowCredentials“record component”(记录组件)。final boolean用于表示另一个对象是否“等于”当前这个对象。final inthashCode()返回该对象的哈希码值。headers()返回该值的值。headers“record component”(记录组件)。mapping()返回该值的值。mapping“record component”(记录组件)。longmaxAge()返回该值的值。maxAge“record component”(记录组件)。methods()返回该值的值。methods“record component”(记录组件)。origins()返回该值的值。origins“record component”(记录组件)。final StringtoString()返回该记录类的字符串表示形式。
-
构造函数详细信息
-
AdkWebCorsProperties
public AdkWebCorsProperties(String mapping, List<String> origins, List<String> methods, List<String> headers, boolean allowCredentials, long maxAge) 创建一个……的实例。AdkWebCorsProperties记录类(Record Class)。- Parameters:
mapping- the value for themappingrecord componentorigins- the value for theoriginsrecord componentmethods- the value for themethodsrecord componentheaders- the value for theheadersrecord componentallowCredentials- the value for theallowCredentialsrecord componentmaxAge- the value for themaxAgerecord component
-
-
方法详细信息(Method Details)
-
toString
-
hashCode
-
equals
用于判断另一个对象是否“等于”当前对象。当另一个对象属于相同的类,并且所有记录组件都相同时,这两个对象才被认为是相等的。其中,某些特定的组件(称为“引用组件”)也需要被进行比较。Objects::equals(Object,Object);原始组件(primitive components)会与……进行比较。compare这些方法来自它们对应的包装类(wrapper classes)。 -
mapping
返回该值的值。mapping“record component”(记录组件)。- Returns:
- the value of the
mappingrecord component
-
origins
-
methods
-
headers
-
allowCredentials
public boolean allowCredentials()返回该值的值。allowCredentials“record component”(记录组件)。- Returns:
- the value of the
allowCredentialsrecord component
-
maxAge
public long maxAge()返回该值的值。maxAge“record component”(记录组件)。- Returns:
- the value of the
maxAgerecord component
-