public final class RequestConditionHolder extends AbstractRequestCondition<RequestConditionHolder>
RequestCondition
useful when the type of the held
request condition is not known ahead of time - e.g. custom condition.
An implementation of RequestCondition
itself, a
RequestConditionHolder
decorates the held request condition allowing
it to be combined and compared with other custom request conditions while
ensuring type and null safety.
Constructor and Description |
---|
RequestConditionHolder(RequestCondition<?> requestCondition)
Create a new holder to wrap the given request condition.
|
Modifier and Type | Method and Description |
---|---|
RequestConditionHolder |
combine(RequestConditionHolder other)
Combine the request conditions held by the two RequestConditionHolder
instances after making sure the conditions are of the same type.
|
int |
compareTo(RequestConditionHolder other,
javax.servlet.http.HttpServletRequest request)
Compare the request conditions held by the two RequestConditionHolder
instances after making sure the conditions are of the same type.
|
RequestCondition<?> |
getCondition()
Return the held request condition, or
null if not holding one. |
protected Collection<?> |
getContent()
Return the discrete items a request condition is composed of.
|
RequestConditionHolder |
getMatchingCondition(javax.servlet.http.HttpServletRequest request)
Get the matching condition for the held request condition wrap it in a
new RequestConditionHolder instance.
|
protected String |
getToStringInfix()
The notation to use when printing discrete items of content.
|
equals, hashCode, toString
public RequestConditionHolder(RequestCondition<?> requestCondition)
requestCondition
- the condition to hold, may be null
public RequestCondition<?> getCondition()
null
if not holding one.protected Collection<?> getContent()
AbstractRequestCondition
getContent
in class AbstractRequestCondition<RequestConditionHolder>
null
protected String getToStringInfix()
AbstractRequestCondition
getToStringInfix
in class AbstractRequestCondition<RequestConditionHolder>
public RequestConditionHolder combine(RequestConditionHolder other)
other
- the condition to combine with.public RequestConditionHolder getMatchingCondition(javax.servlet.http.HttpServletRequest request)
null
if there is no match.public int compareTo(RequestConditionHolder other, javax.servlet.http.HttpServletRequest request)
Copyright © 2014. All Rights Reserved.