Packages

c

akka.http.scaladsl.server

TransformationRejection

final case class TransformationRejection(transform: (Seq[Rejection]) => Seq[Rejection]) extends javadsl.server.TransformationRejection with Rejection with Product with 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).

Source
Rejection.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransformationRejection
  2. Serializable
  3. Product
  4. Equals
  5. Rejection
  6. TransformationRejection
  7. Rejection
  8. AnyRef
  9. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new TransformationRejection(transform: (Seq[Rejection]) => Seq[Rejection])

Value Members

  1. def getTransform: Function[Iterable[javadsl.server.Rejection], Iterable[javadsl.server.Rejection]]
  2. def productElementNames: Iterator[String]
    Definition Classes
    Product
  3. val transform: (Seq[Rejection]) => Seq[Rejection]