Package akka.http.scaladsl.server
Class TransformationRejection
java.lang.Object
akka.http.scaladsl.server.TransformationRejection
- All Implemented Interfaces:
Rejection
,TransformationRejection
,Rejection
,Serializable
,scala.Equals
,scala.Product
public final class TransformationRejection
extends Object
implements TransformationRejection, Rejection, scala.Product, Serializable
A special Rejection that serves as a container for a transformation function on rejections.
It is used by some directives to "cancel" rejections that are added by later directives of a similar type.
Consider this route structure for example:
put { reject(ValidationRejection("no") } ~ get { ... }
If this structure is applied to a PUT request the list of rejections coming back contains three elements:
1. A ValidationRejection 2. A MethodRejection 3. A TransformationRejection holding a function filtering out the MethodRejection
so that in the end the RejectionHandler will only see one rejection (the ValidationRejection), because the
MethodRejection added by the get
directive is canceled by the put
directive (since the HTTP method
did indeed match eventually).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTransformationRejection
(scala.Function1<scala.collection.immutable.Seq<Rejection>, scala.collection.immutable.Seq<Rejection>> transform) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface scala.Equals
canEqual, equals
Methods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
-
Constructor Details
-
TransformationRejection
-
-
Method Details
-
apply
public abstract static R apply(T1 v1) -
toString
-
transform
-
getTransform
- Specified by:
getTransform
in interfaceTransformationRejection
-