本文整理了Java中play.libs.Scala.asJava()
方法的一些代码示例,展示了Scala.asJava()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scala.asJava()
方法的具体详情如下:
包路径:play.libs.Scala
类名称:Scala
方法名:asJava
[英]Converts a scala Tuple2 to a java F.Tuple.
[中]将scala Tuple2转换为java F.Tuple。
代码示例来源:origin: com.typesafe.play/play-test_2.12
/**
* Constructs a in-memory (h2) database configuration to add to a fake application.
*
* @param name the database name.
* @param options the database options.
* @return a map of String containing database config info.
*/
public static Map<String, String> inMemoryDatabase(String name, Map<String, String> options) {
return Scala.asJava(play.api.test.Helpers.inMemoryDatabase(name, Scala.asScala(options)));
}
代码示例来源:origin: com.typesafe.play/play-test_2.10
/**
* Constructs a in-memory (h2) database configuration to add to a FakeApplication.
*/
public static Map<String,String> inMemoryDatabase(String name, Map<String, String> options) {
return Scala.asJava(play.api.test.Helpers.inMemoryDatabase(name, Scala.asScala(options)));
}
代码示例来源:origin: com.typesafe.play/play-test_2.11
/**
* Constructs a in-memory (h2) database configuration to add to a fake application.
*
* @param name the database name.
* @param options the database options.
* @return a map of String containing database config info.
*/
public static Map<String, String> inMemoryDatabase(String name, Map<String, String> options) {
return Scala.asJava(play.api.test.Helpers.inMemoryDatabase(name, Scala.asScala(options)));
}
代码示例来源:origin: com.typesafe.play/play_2.12
public List<String> getModifiers() {
return Scala.asJava(modifiers());
}
}
代码示例来源:origin: com.typesafe.play/play_2.11
@Inject
public Langs(play.api.i18n.Langs langs) {
this.langs = langs;
List<Lang> availables = new ArrayList<>();
for (play.api.i18n.Lang lang : Scala.asJava(langs.availables())) {
availables.add(new Lang(lang));
}
this.availables = Collections.unmodifiableList(availables);
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Retrieve Lang availables from the application configuration.
*
* @param app the current application.
* @return the list of available Lang.
*/
public static List<Lang> availables(Application app) {
play.api.i18n.Langs langs = app.injector().instanceOf(play.api.i18n.Langs.class);
List<play.api.i18n.Lang> availableLangs = Scala.asJava(langs.availables());
return availableLangs.stream().map(Lang::new).collect(toList());
}
代码示例来源:origin: com.typesafe.play/play
/**
* Retrieve Lang availables from the application configuration.
*
* @param app the current application.
* @return the list of available Lang.
*/
public static List<Lang> availables(Application app) {
play.api.i18n.Langs langs = app.injector().instanceOf(play.api.i18n.Langs.class);
List<play.api.i18n.Lang> availableLangs = Scala.asJava(langs.availables());
return availableLangs.stream().map(Lang::new).collect(toList());
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* @return the client X509Certificates if they have been set
*/
public Optional<List<X509Certificate>> clientCertificateChain() {
return OptionConverters.toJava(
req.connection().clientCertificateChain()).map(
list -> new ArrayList<>(Scala.asJava(list)));
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* @return the sessions in the request
*/
public Map<String,String> session() {
return Scala.asJava(req.session().data());
}
代码示例来源:origin: com.typesafe.play/play
/**
* @return the client X509Certificates if they have been set
*/
public Optional<List<X509Certificate>> clientCertificateChain() {
return OptionConverters.toJava(
req.connection().clientCertificateChain()).map(
list -> new ArrayList<>(Scala.asJava(list)));
}
代码示例来源:origin: com.typesafe.play/play_2.12
@Override
default void configure(scala.collection.immutable.Map<String, String> properties, Option<URL> config) {
configure(
Scala.asJava(properties),
OptionConverters.toJava(config)
);
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Retrieve Lang availables from the application configuration.
*/
public static List<Lang> availables() {
List<play.api.i18n.Lang> langs = Scala.asJava(play.api.i18n.Lang.availables(play.api.Play.current()));
List<play.i18n.Lang> result = new ArrayList<play.i18n.Lang>();
for(play.api.i18n.Lang lang: langs) {
result.add(new Lang(lang));
}
return result;
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* @return the cookies in a Java map
*/
public Map<String,String> flash() {
return Scala.asJava(req.flash().data());
}
代码示例来源:origin: com.typesafe.play/play_2.11
@Override
default void configure(scala.collection.immutable.Map<String, String> properties, Option<URL> config) {
configure(
Scala.asJava(properties),
OptionConverters.toJava(config)
);
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* @return the client X509Certificates if they have been set
*/
public Optional<List<X509Certificate>> clientCertificateChain() {
return OptionConverters.toJava(
req.connection().clientCertificateChain()).map(
list -> new ArrayList<>(Scala.asJava(list)));
}
代码示例来源:origin: com.typesafe.play/play
/**
* @return the sessions in the request
*/
public Map<String,String> session() {
return Scala.asJava(req.session().data());
}
代码示例来源:origin: com.typesafe.play/play_2.12
@Override
default void configure(play.api.Environment env, Configuration configuration, scala.collection.immutable.Map<String, String> optionalProperties) {
configure(
env.asJava(),
configuration.underlying(),
Scala.asJava(optionalProperties)
);
}
代码示例来源:origin: com.typesafe.play/play_2.11
@Override
default void configure(play.api.Environment env, Configuration configuration, scala.collection.immutable.Map<String, String> optionalProperties) {
configure(
env.asJava(),
configuration.underlying(),
Scala.asJava(optionalProperties)
);
}
代码示例来源:origin: com.typesafe.play/play_2.12
static Map<String, String> generateProperties(Environment env, Config config, Map<String, String> optionalProperties) {
scala.collection.immutable.Map<String, String> generateProperties = LoggerConfigurator$.MODULE$.generateProperties(
env.asScala(),
new Configuration(config),
Scala.asScala(optionalProperties)
);
return Scala.asJava(generateProperties);
}
}
代码示例来源:origin: com.typesafe.play/play
static Map<String, String> generateProperties(Environment env, Config config, Map<String, String> optionalProperties) {
scala.collection.immutable.Map<String, String> generateProperties = LoggerConfigurator$.MODULE$.generateProperties(
env.asScala(),
new Configuration(config),
Scala.asScala(optionalProperties)
);
return Scala.asJava(generateProperties);
}
}
内容来源于网络,如有侵权,请联系作者删除!