com.gu.contentapi.client.Parameter.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of content-api-client_2.12 Show documentation
Show all versions of content-api-client_2.12 Show documentation
Scala client for the Guardian's Content API
The newest version!
package com.gu.contentapi.client
trait Parameter {
type Self
type ParameterOwner <: Parameters[ParameterOwner]
def owner: ParameterOwner
def name: String
def value: Option[Self]
def asTuple = value.map(name -> _)
def withValue(newValue: Option[Self]): Parameter
def apply(newValue: Self): ParameterOwner = apply(Some(newValue))
def apply(newValue: Option[Self]): ParameterOwner = owner.withParameter(this.withValue(newValue))
def reset(): ParameterOwner = owner.withParameters(Map.empty)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy