Class CompositeCustomRequestCondition

java.lang.Object
org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<CompositeCustomRequestCondition>
com.foreach.across.modules.web.mvc.condition.CompositeCustomRequestCondition
All Implemented Interfaces:
org.springframework.web.servlet.mvc.condition.RequestCondition<CompositeCustomRequestCondition>

public final class CompositeCustomRequestCondition extends org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<CompositeCustomRequestCondition>
Collection of CustomRequestCondition with different semantics than the CompositeRequestCondition. When combining, this implementation will merge the collections. Condition types existing on both ends will be combined, else it will be added to the resulting collection.

Only a single condition of the same type is allowed in the collection. An exception will be thrown if more than one condition of the same type is added.

This condition only matches if all of its members match.

Since:
2.0.0
Author:
Marc Vanbrabant, Arne Vandamme
  • Constructor Details

  • Method Details

    • combine

      If one instance is empty, return the other. If both instances have conditions, combine the conditions of the same type, add all others.
    • getMatchingCondition

      public CompositeCustomRequestCondition getMatchingCondition(jakarta.servlet.http.HttpServletRequest request)
    • compareTo

      public int compareTo(CompositeCustomRequestCondition other, jakarta.servlet.http.HttpServletRequest request)
      If one instance is empty, the other "wins". If both instances have conditions, compare them in the order in which they were provided. A condition with more members always has precedence over one with fewer, as it is considered to be a more specific match.
    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<CompositeCustomRequestCondition>
    • getContent

      protected Collection<CustomRequestCondition> getContent()
      Specified by:
      getContent in class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<CompositeCustomRequestCondition>
    • getToStringInfix

      protected String getToStringInfix()
      Specified by:
      getToStringInfix in class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<CompositeCustomRequestCondition>