Record Class RouteDescriptor

java.lang.Object
java.lang.Record
io.kroxylicious.proxy.internal.routing.RouteDescriptor
Record Components:
name - the route name
id - numeric identifier used in the virtual node ID mapping formula
targetCluster - the target cluster for this route, or null if targeting a nested router
routerName - the name of a nested router to forward to, or null if targeting a cluster
filters - per-route filter definitions (may be empty)

public record RouteDescriptor(String name, int id, TargetCluster targetCluster, String routerName, List<NamedFilterDefinition> filters) extends Record
Runtime representation of a resolved route within a router.
  • Constructor Details

    • RouteDescriptor

      public RouteDescriptor(String name, int id, @Nullable TargetCluster targetCluster, @Nullable String routerName, List<NamedFilterDefinition> filters)
      Creates an instance of a RouteDescriptor record class.
      Parameters:
      name - the value for the name record component
      id - the value for the id record component
      targetCluster - the value for the targetCluster record component
      routerName - the value for the routerName record component
      filters - the value for the filters record component
  • Method Details

    • targetsCluster

      public boolean targetsCluster()
      Returns true if this route targets a Kafka cluster.
    • targetsRouter

      public boolean targetsRouter()
      Returns true if this route targets a nested router.
    • 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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • targetCluster

      @Nullable public TargetCluster targetCluster()
      Returns the value of the targetCluster record component.
      Returns:
      the value of the targetCluster record component
    • routerName

      @Nullable public String routerName()
      Returns the value of the routerName record component.
      Returns:
      the value of the routerName record component
    • filters

      public List<NamedFilterDefinition> filters()
      Returns the value of the filters record component.
      Returns:
      the value of the filters record component