/** * Returns a new session with the given keys removed. */ public Session removing(String... keys) { return new play.api.mvc.Session(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava(); }
public Session(play.api.mvc.Session underlying) { this(Scala.asJava(underlying.data())); }
/** * Returns a new session with the given key-value pair added. */ public Session adding(String key, String value) { return new play.api.mvc.Session(Scala.asScala(this)).$plus(Scala.Tuple(key, value)).asJava(); }
/** * Returns a new session with the values from the given map added. */ public Session adding(Map<String, String> values) { return new play.api.mvc.Session(Scala.asScala(this)).$plus$plus(Scala.asScala(values)).asJava(); }
/** * 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; }
/** * Convert this session to a Scala session. * * @return the Scala session. */ public play.api.mvc.Session asScala() { return new play.api.mvc.Session(Scala.asScala(this)); }
/** * Parses the Session cookie and returns the Session data. The request's session cookie is stored in an attribute indexed by * {@link RequestAttrKey#Session()}. The attribute uses a {@link Cell} to store the session cookie, to allow it to be evaluated on-demand. */ default Session session() { return attrs().get(RequestAttrKey.Session().asJava()).value().asJava(); }
/** * Convert this result to a Scala result. * * @return the Scala result. */ public play.api.mvc.Result asScala() { return new play.api.mvc.Result( header.asScala(), body.asScala(), session == null ? Scala.None() : Scala.Option(play.api.mvc.Session.fromJavaSession(session)), flash == null ? Scala.None() : Scala.Option(play.api.mvc.Flash.fromJavaFlash(flash)), JavaHelpers$.MODULE$.cookiesToScalaCookies(cookies) ); } }
/** * Returns a new session with the values from the given map added. */ public Session adding(Map<String, String> values) { return new play.api.mvc.Session(Scala.asScala(this)).$plus$plus(Scala.asScala(values)).asJava(); }
/** * 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; }
/** * Convert this session to a Scala session. * * @return the Scala session. */ public play.api.mvc.Session asScala() { return new play.api.mvc.Session(Scala.asScala(this)); }
/** * Parses the Session cookie and returns the Session data. The request's session cookie is stored in an attribute indexed by * {@link RequestAttrKey#Session()}. The attribute uses a {@link Cell} to store the session cookie, to allow it to be evaluated on-demand. */ default Session session() { return attrs().get(RequestAttrKey.Session().asJava()).value().asJava(); }
/** * Convert this result to a Scala result. * * @return the Scala result. */ public play.api.mvc.Result asScala() { return new play.api.mvc.Result( header.asScala(), body.asScala(), session == null ? Scala.None() : Scala.Option(play.api.mvc.Session.fromJavaSession(session)), flash == null ? Scala.None() : Scala.Option(play.api.mvc.Flash.fromJavaFlash(flash)), JavaHelpers$.MODULE$.cookiesToScalaCookies(cookies) ); } }
/** * Returns a new session with the given keys removed. */ public Session removing(String... keys) { return new play.api.mvc.Session(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava(); }
/** * Returns a new session with the values from the given map added. */ public Session adding(Map<String, String> values) { return new play.api.mvc.Session(Scala.asScala(this)).$plus$plus(Scala.asScala(values)).asJava(); }
/** * Returns a new session with the given key-value pair added. */ public Session adding(String key, String value) { return new play.api.mvc.Session(Scala.asScala(this)).$plus(Scala.Tuple(key, value)).asJava(); }
/** * 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; }
public Session(play.api.mvc.Session underlying) { this(Scala.asJava(underlying.data())); }
/** * Convert this session to a Scala session. * * @return the Scala session. */ public play.api.mvc.Session asScala() { return new play.api.mvc.Session(Scala.asScala(this)); }
/** * Parses the Session cookie and returns the Session data. The request's session cookie is stored in an attribute indexed by * {@link RequestAttrKey#Session()}. The attribute uses a {@link Cell} to store the session cookie, to allow it to be evaluated on-demand. */ default Session session() { return attrs().get(RequestAttrKey.Session().asJava()).value().asJava(); }