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 is false.
  • enabledRegisterEndpoint: Automatically register all `Transport` as Endpoints for this A2A service, default is true. When set to false, 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`.
  • Constructor Details

    • NacosA2aRegistryProperties

      public NacosA2aRegistryProperties(boolean isSetAsLatest, boolean enabledRegisterEndpoint, String overwritePreferredTransport, Map<String,NacosA2aRegistryTransportProperties> transportProperties)
      Creates an instance of a NacosA2aRegistryProperties record class.
      Parameters:
      isSetAsLatest - the value for the isSetAsLatest record component
      enabledRegisterEndpoint - the value for the enabledRegisterEndpoint record component
      overwritePreferredTransport - the value for the overwritePreferredTransport record component
      transportProperties - the value for the transportProperties record component
  • Method Details

    • addTransport

      public void addTransport(NacosA2aRegistryTransportProperties transport)
      Adds properties of transport to the registry.

      Each transport will be transferred to AgentEndpoint and registered into Nacos.

      Parameters:
      transport - properties of transport
    • builder

      public static NacosA2aRegistryProperties.Builder builder()
      Creates a new builder instance for NacosA2aRegistryProperties.
      Returns:
      builder instance
    • builder

      Creates a new builder instance for NacosA2aRegistryProperties from 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • isSetAsLatest

      public boolean isSetAsLatest()
      Returns the value of the isSetAsLatest record component.
      Returns:
      the value of the isSetAsLatest record component
    • enabledRegisterEndpoint

      public boolean enabledRegisterEndpoint()
      Returns the value of the enabledRegisterEndpoint record component.
      Returns:
      the value of the enabledRegisterEndpoint record component
    • overwritePreferredTransport

      public String overwritePreferredTransport()
      Returns the value of the overwritePreferredTransport record component.
      Returns:
      the value of the overwritePreferredTransport record component
    • transportProperties

      public Map<String,NacosA2aRegistryTransportProperties> transportProperties()
      Returns the value of the transportProperties record component.
      Returns:
      the value of the transportProperties record component