trait QueryParameters[Q, A] extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. QueryParameters
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def createParams(q: Q): Map[String, Param]

    Generate a map of parameters representing the argument q.

    Generate a map of parameters representing the argument q.

    matchParams and createParams should be (functional) inverse of each other. That is, this.matchParams(this.createParams(q)) == Right(ParamMathOutput(q, Map())) (this property is called "LeftInverse" in the tests)

  2. abstract def matchParams(params: Map[String, Param]): Either[A, ParamMatchOutput[Q]]

    Tries to match the map of urldsl.vocabulary.Params to create an instance of Q.

    Tries to match the map of urldsl.vocabulary.Params to create an instance of Q. If it can not, it returns an error indicating the reason of the failure. If it could, it returns the value of Q, as well as the list of unused parameters.

    params

    The map of urldsl.vocabulary.Param to match this path segment again.

    returns

    The "de-serialized" element with unused parameters, if successful.

    Example:
    1. For example, if you try to match a param "name" as String and "age" as Int, calling matchParams on Map("name" -> Param(List("Alice")), "age" -> Param(List("24"), "year" -> Param(List("2020"))) will return Right(ParamMatchOutput(("Alice", 24), Map("year" -> Param(List("2020")))

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def &[R](that: QueryParameters[R, A])(implicit ev: Tupler[Q, R]): QueryParameters[Out, A]

    Adds that QueryParameters to this one, "tupling" the returned type with the implicit urldsl.language.Tupler

    Adds that QueryParameters to this one, "tupling" the returned type with the implicit urldsl.language.Tupler

    The matching and writing of strings is functionally commutative under &, but the returned type Q is not. So, if you have two parameters, one matching an Int and the other one a String, depending on the order in which & is called, you can end up with "Q = (Int, String)" or "Q = (String, Int)". This property is called "QuasiCommutativity" in the tests.

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def ?: QueryParameters[Option[Q], A]

    When these query parameters return an error, transform it to None instead.

    When these query parameters return an error, transform it to None instead.

    This should be used to represent (possibly) missing parameters.

  6. final def as[R](implicit codec: Codec[Q, R]): QueryParameters[R, A]

    Casts this QueryParameters to the new type R.

    Casts this QueryParameters to the new type R. Note that the urldsl.vocabulary.Codec must be an exception-free bijection between Q and R.

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. final def createParamsMap(q: Q, encoder: UrlStringGenerator = UrlStringGenerator.default): Map[String, List[String]]

    Generates a Map of parameters representing the argument q.

    Generates a Map of parameters representing the argument q. The keys are not encoded, but the values are lists of encoded strings.

  10. final def createParamsString(q: Q, encoder: UrlStringGenerator = UrlStringGenerator.default): String

    Generates the query string representing the argument q.

    Generates the query string representing the argument q. This String can be used to be part of a URL.

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. final def filter(predicate: (Q) => Boolean)(implicit ev: =:=[DummyError, A]): QueryParameters[Q, A]

    Sugar for when A =:= DummyError.

  14. final def filter(predicate: (Q) => Boolean, error: (Map[String, Param]) => A): QueryParameters[Q, A]

    Adds an extra satisfying criteria to the output of this QueryParameters.

    Adds an extra satisfying criteria to the output of this QueryParameters. If the output satisfies the given predicate, then it is left unchanged. Otherwise, it returns the given error.

    Note that it doesn't check that arguments given to createParams satisfy this predicate // todo[behaviour]: should that change?

    predicate

    the additional predicate that the output must satisfy

    error

    the generated error in case it does not satisfy it

    returns

    a new QueryParameters instance with the same types

    Example:
    1. param[Int]("age").filter(_ >= 0, (params: Map[String, Param]) => someError(params))
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def matchQueryString(queryString: String, decoder: UrlStringDecoder = UrlStringDecoder.defaultDecoder): Either[A, Q]
  20. def matchRawUrl(url: String, urlStringParserGenerator: UrlStringParserGenerator = UrlStringParserGenerator.defaultUrlStringParserGenerator): Either[A, Q]
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped