play.libs.Scala.Tuple()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(273)

本文整理了Java中play.libs.Scala.Tuple()方法的一些代码示例,展示了Scala.Tuple()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scala.Tuple()方法的具体详情如下:
包路径:play.libs.Scala
类名称:Scala
方法名:Tuple

Scala.Tuple介绍

[英]Creates a Scala Tuple2.
[中]创建Scala Tuple2。

代码示例

代码示例来源:origin: com.typesafe.play/play

/**
 * Returns a new flash with the given key-value pair added.
 */
public Flash adding(String key, String value) {
  return new play.api.mvc.Flash(Scala.asScala(this)).$plus(Scala.Tuple(key, value)).asJava();
}

代码示例来源:origin: com.typesafe.play/play_2.12

/**
 * 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();
}

代码示例来源:origin: com.typesafe.play/play_2.12

/**
 * Returns a new flash with the given key-value pair added.
 */
public Flash adding(String key, String value) {
  return new play.api.mvc.Flash(Scala.asScala(this)).$plus(Scala.Tuple(key, value)).asJava();
}

代码示例来源:origin: com.typesafe.play/play_2.11

/**
 * 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();
}

代码示例来源:origin: com.typesafe.play/play_2.11

/**
 * Returns a new flash with the given key-value pair added.
 */
public Flash adding(String key, String value) {
  return new play.api.mvc.Flash(Scala.asScala(this)).$plus(Scala.Tuple(key, value)).asJava();
}

代码示例来源:origin: com.typesafe.play/play

/**
 * 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();
}

代码示例来源:origin: play/play-test

/**
 * Set a Form url encoded body to this request.
 */
@SuppressWarnings(value = "unchecked")
public FakeRequest withFormUrlEncodedBody(java.util.Map<String,String> data) {
  List<scala.Tuple2<String,String>> args = new ArrayList<scala.Tuple2<String,String>>();
  for(String key: data.keySet()) {
    scala.Tuple2<String,String> pair = Scala.Tuple(key, data.get(key));
    args.add(pair);
  }
  fake = fake.withFormUrlEncodedBody(Scala.toSeq(args));
  return this;
}

代码示例来源:origin: play/play-test

/**
 * Add additional headers to this request.
 */
@SuppressWarnings(value = "unchecked")
public FakeRequest withHeader(String name, String value) {
  fake = fake.withHeaders(Scala.varargs(Scala.Tuple(name, value)));
  return this;
}

代码示例来源:origin: play/play-test

/**
 * Add addtional session to this request.
 */
@SuppressWarnings(value = "unchecked")
public FakeRequest withFlash(String name, String value) {
  fake = fake.withFlash(Scala.varargs(Scala.Tuple(name, value)));
  return this;
}

代码示例来源:origin: play/play-test

/**
 * Add addtional session to this request.
 */
@SuppressWarnings(value = "unchecked")  
public FakeRequest withSession(String name, String value) {
  fake = fake.withSession(Scala.varargs(Scala.Tuple(name, value)));
  return this;
}

相关文章