Record Class NacosA2aRegistryProperties
java.lang.Object
java.lang.Record
io.agentscope.core.nacos.a2a.registry.NacosA2aRegistryProperties
public record NacosA2aRegistryProperties(boolean isSetAsLatest, boolean enabledRegisterEndpoint, String overwritePreferredTransport, Map<String,NacosA2aRegistryTransportProperties> transportProperties)
extends Record
Properties for A2A AgentCard and Endpoint registry to Nacos.
Property description:
isSetAsLatest: Always register the A2A service as the latest version, default isfalse.enabledRegisterEndpoint: Automatically register all `Transport` as Endpoints for this A2A service, default istrue. When set tofalse, only Agent Card will be published.overwritePreferredTransport: When registering A2A services, use this `Transport` to override the `preferredTransport` and `url` in the Agent Card, default is `null`.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionNacosA2aRegistryProperties(boolean isSetAsLatest, boolean enabledRegisterEndpoint, String overwritePreferredTransport, Map<String, NacosA2aRegistryTransportProperties> transportProperties) Creates an instance of aNacosA2aRegistryPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransport(NacosA2aRegistryTransportProperties transport) Adds properties of transport to the registry.builder()Creates a new builder instance forNacosA2aRegistryProperties.builder(NacosA2aRegistryProperties prototype) Creates a new builder instance forNacosA2aRegistryPropertiesfrom an existing prototype instance.booleanReturns the value of theenabledRegisterEndpointrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisSetAsLatestrecord component.Returns the value of theoverwritePreferredTransportrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransportPropertiesrecord component.
-
Constructor Details
-
NacosA2aRegistryProperties
public NacosA2aRegistryProperties(boolean isSetAsLatest, boolean enabledRegisterEndpoint, String overwritePreferredTransport, Map<String, NacosA2aRegistryTransportProperties> transportProperties) Creates an instance of aNacosA2aRegistryPropertiesrecord class.- Parameters:
isSetAsLatest- the value for theisSetAsLatestrecord componentenabledRegisterEndpoint- the value for theenabledRegisterEndpointrecord componentoverwritePreferredTransport- the value for theoverwritePreferredTransportrecord componenttransportProperties- the value for thetransportPropertiesrecord component
-
-
Method Details
-
addTransport
Adds properties of transport to the registry.Each transport will be transferred to
AgentEndpointand registered into Nacos.- Parameters:
transport- properties of transport
-
builder
Creates a new builder instance forNacosA2aRegistryProperties.- Returns:
- builder instance
-
builder
Creates a new builder instance forNacosA2aRegistryPropertiesfrom an existing prototype instance.The new builder will contain the same values as the prototype instance exclude
transportProperties.- Parameters:
prototype- the prototype instance to copy properties from- Returns:
- builder instance
-
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. -
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. -
equals
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
isSetAsLatest
public boolean isSetAsLatest()Returns the value of theisSetAsLatestrecord component.- Returns:
- the value of the
isSetAsLatestrecord component
-
enabledRegisterEndpoint
public boolean enabledRegisterEndpoint()Returns the value of theenabledRegisterEndpointrecord component.- Returns:
- the value of the
enabledRegisterEndpointrecord component
-
overwritePreferredTransport
Returns the value of theoverwritePreferredTransportrecord component.- Returns:
- the value of the
overwritePreferredTransportrecord component
-
transportProperties
Returns the value of thetransportPropertiesrecord component.- Returns:
- the value of the
transportPropertiesrecord component
-