Record Class PrioritizedFilter

java.lang.Object
java.lang.Record
org.apache.camel.component.dynamicrouter.filter.PrioritizedFilter
Record Components:
id - The identifier for this prioritized filter.
priority - The priority value of this processor.
predicate - the rule expression
endpoint - the destination endpoint for matching exchanges
statistics - the object that holds routing statistics for this filter
All Implemented Interfaces:
Comparable<PrioritizedFilter>

public record PrioritizedFilter(String id, int priority, org.apache.camel.Predicate predicate, String endpoint, PrioritizedFilterStatistics statistics) extends Record implements Comparable<PrioritizedFilter>
This class serves as a wrapper around a FilterProcessor to include an integer representing the priority of this processor, and a Comparator to sort by priority, then by id.
  • Constructor Details

    • PrioritizedFilter

      public PrioritizedFilter(String id, int priority, org.apache.camel.Predicate predicate, String endpoint, PrioritizedFilterStatistics statistics)
      Creates an instance of a PrioritizedFilter record class.
      Parameters:
      id - the value for the id record component
      priority - the value for the priority record component
      predicate - the value for the predicate record component
      endpoint - the value for the endpoint record component
      statistics - the value for the statistics record component
  • Method Details

    • compareTo

      public int compareTo(PrioritizedFilter other)
      Compare the priority of this instance to the priority of the parameter.
      Specified by:
      compareTo in interface Comparable<PrioritizedFilter>
      Parameters:
      other - the processor to compare with
      Returns:
      the result of the priority comparison
    • toString

      public String toString()
      Create a string representation of this processor.
      Specified by:
      toString in class Record
      Returns:
      the string representation of this processor
    • 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.
    • id

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

      public int priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • predicate

      public org.apache.camel.Predicate predicate()
      Returns the value of the predicate record component.
      Returns:
      the value of the predicate record component
    • endpoint

      public String endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • statistics

      public PrioritizedFilterStatistics statistics()
      Returns the value of the statistics record component.
      Returns:
      the value of the statistics record component