@Benchmark public scala.collection.immutable.Map<String, String> immutableScalaPut() { int localSize = this.size; String[] localElements = this.elements; scala.collection.immutable.Map<String, String> map = HashMap$.MODULE$.empty(); for (int i = 0; i < localSize; i++) { map = map.updated(localElements[i], "dummy"); } return map; } }
@Setup public void setUp() { Random random = new Random(123456789012345L); this.elements = new String[this.size]; Map<String, String> map = HashMap$.MODULE$.empty(); for (int i = 0; i < this.size; i++) { String element = RandomStringUtils.random(RANDOM_COUNT, 0, 0, false, true, null, random); this.elements[i] = element; map = map.updated(element, "dummy"); } this.scalaMap = map; }
/** * 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; }
/** * 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; }
/** * 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; }