本文整理了Java中scala.collection.immutable.Map.updated()
方法的一些代码示例,展示了Map.updated()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Map.updated()
方法的具体详情如下:
包路径:scala.collection.immutable.Map
类名称:Map
方法名:updated
暂无
代码示例来源:origin: goldmansachs/gs-collections
@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;
}
}
代码示例来源:origin: goldmansachs/gs-collections
@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;
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* 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;
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* 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;
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* 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;
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* 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;
}
代码示例来源:origin: com.typesafe.play/play
/**
* 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;
}
代码示例来源:origin: com.typesafe.play/play
/**
* 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;
}
内容来源于网络,如有侵权,请联系作者删除!