/** * Creates a TypedKey with the given name. * * @param displayName The name to display when printing this key. * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create(String displayName) { return new TypedKey<>(TypedKey$.MODULE$.apply(displayName)); }
/** * Creates a TypedKey with the given name. * * @param displayName The name to display when printing this key. * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create(String displayName) { return new TypedKey<>(TypedKey$.MODULE$.apply(displayName)); }
/** * Creates a TypedKey without a name. * * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create() { return new TypedKey<>(TypedKey$.MODULE$.apply()); }
/** * Creates a TypedKey with the given name. * * @param displayName The name to display when printing this key. * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create(String displayName) { return new TypedKey<>(TypedKey$.MODULE$.apply(displayName)); }
/** * Creates a TypedKey without a name. * * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create() { return new TypedKey<>(TypedKey$.MODULE$.apply()); }
/** * Creates a TypedKey without a name. * * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create() { return new TypedKey<>(TypedKey$.MODULE$.apply()); }
/** * @param id the id to be used * @return the builder instance */ public RequestBuilder id(Long id) { attr(new TypedKey<>(RequestAttrKey.Id()), id); return this; }
/** * @param id the id to be used * @return the builder instance */ public RequestBuilder id(Long id) { attr(new TypedKey<>(RequestAttrKey.Id()), id); return this; }
/** * @param id the id to be used * @return the builder instance */ public RequestBuilder id(Long id) { attr(new TypedKey<>(RequestAttrKey.Id()), id); return this; }
/** * Sets cookies in a request. * @param data a key value mapping of cookies * @return the builder instance */ public RequestBuilder flash(Map<String,String> data) { play.api.mvc.Flash flash = new play.api.mvc.Flash(Scala.asScala(data)); attr(new TypedKey<>(RequestAttrKey.Flash()), new AssignedCell<>(flash)); return this; }
/** * Sets all parameters for the session. * @param data a key value mapping of the session data * @return the builder instance */ public RequestBuilder session(Map<String,String> data) { play.api.mvc.Session session = new play.api.mvc.Session(Scala.asScala(data)); attr(new TypedKey<>(RequestAttrKey.Session()), new AssignedCell<>(session)); return this; }
/** * Sets all parameters for the session. * @param data a key value mapping of the session data * @return the builder instance */ public RequestBuilder session(Map<String,String> data) { play.api.mvc.Session session = new play.api.mvc.Session(Scala.asScala(data)); attr(new TypedKey<>(RequestAttrKey.Session()), new AssignedCell<>(session)); return this; }
/** * Sets all parameters for the session. * @param data a key value mapping of the session data * @return the builder instance */ public RequestBuilder session(Map<String,String> data) { play.api.mvc.Session session = new play.api.mvc.Session(Scala.asScala(data)); attr(new TypedKey<>(RequestAttrKey.Session()), new AssignedCell<>(session)); return this; }
/** * Sets cookies in a request. * @param data a key value mapping of cookies * @return the builder instance */ public RequestBuilder flash(Map<String,String> data) { play.api.mvc.Flash flash = new play.api.mvc.Flash(Scala.asScala(data)); attr(new TypedKey<>(RequestAttrKey.Flash()), new AssignedCell<>(flash)); return this; }
/** * Sets cookies in a request. * @param data a key value mapping of cookies * @return the builder instance */ public RequestBuilder flash(Map<String,String> data) { play.api.mvc.Flash flash = new play.api.mvc.Flash(Scala.asScala(data)); attr(new TypedKey<>(RequestAttrKey.Flash()), new AssignedCell<>(flash)); return this; }
/** * Sets one cookie. * @param cookie the cookie to be set * @return the builder instance */ public RequestBuilder cookie(Cookie cookie) { play.api.mvc.Cookies newCookies = JavaHelpers$.MODULE$.mergeNewCookie( req.cookies(), cookie.asScala() ); attr(new TypedKey<>(RequestAttrKey.Cookies()), new AssignedCell<>(newCookies)); return this; }
/** * Sets one cookie. * @param cookie the cookie to be set * @return the builder instance */ public RequestBuilder cookie(Cookie cookie) { play.api.mvc.Cookies newCookies = JavaHelpers$.MODULE$.mergeNewCookie( req.cookies(), cookie.asScala() ); attr(new TypedKey<>(RequestAttrKey.Cookies()), new AssignedCell<>(newCookies)); return this; }
/** * Sets one cookie. * @param cookie the cookie to be set * @return the builder instance */ public RequestBuilder cookie(Cookie cookie) { play.api.mvc.Cookies newCookies = JavaHelpers$.MODULE$.mergeNewCookie( req.cookies(), cookie.asScala() ); attr(new TypedKey<>(RequestAttrKey.Cookies()), new AssignedCell<>(newCookies)); return this; }
/** * Sets a cookie in the request. * @param key the key for the cookie * @param value the value for the cookie * @return the builder instance */ public RequestBuilder flash(String key, String value) { scala.collection.immutable.Map<String,String> data = req.flash().data(); scala.collection.immutable.Map<String,String> newData = data.updated(key, value); play.api.mvc.Flash newFlash = new play.api.mvc.Flash(newData); attr(new TypedKey<>(RequestAttrKey.Flash()), new AssignedCell<>(newFlash)); return this; }
/** * Sets a session. * @param key the key for the session * @param value the value associated with the key for the session * @return the builder instance */ public RequestBuilder session(String key, String value) { scala.collection.immutable.Map<String,String> data = req.session().data(); scala.collection.immutable.Map<String,String> newData = data.updated(key, value); play.api.mvc.Session newSession = new play.api.mvc.Session(newData); attr(new TypedKey<>(RequestAttrKey.Session()), new AssignedCell<>(newSession)); return this; }