本文整理了Java中scala.collection.JavaConverters.asScalaBufferConverter()
方法的一些代码示例,展示了JavaConverters.asScalaBufferConverter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JavaConverters.asScalaBufferConverter()
方法的具体详情如下:
包路径:scala.collection.JavaConverters
类名称:JavaConverters
方法名:asScalaBufferConverter
暂无
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Converts a Java List to Scala Seq.
*
* @param list the java list.
* @return the converted Seq.
* @param <T> the element type.
*/
public static <T> scala.collection.Seq<T> toSeq(java.util.List<T> list) {
return scala.collection.JavaConverters.asScalaBufferConverter(list).asScala();
}
代码示例来源:origin: com.typesafe.play/play
/**
* Converts a Java List to Scala Seq.
*
* @param list the java list.
* @return the converted Seq.
* @param <T> the element type.
*/
public static <T> scala.collection.Seq<T> toSeq(java.util.List<T> list) {
return scala.collection.JavaConverters.asScalaBufferConverter(list).asScala();
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* Converts a Java List to Scala Seq.
*
* @param list the java list.
* @return the converted Seq.
* @param <T> the element type.
*/
public static <T> scala.collection.Seq<T> toSeq(java.util.List<T> list) {
return scala.collection.JavaConverters.asScalaBufferConverter(list).asScala();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Converts the varargs to a scala buffer,
* takes care of wrapping varargs into a intermediate list if necessary
*
* @param args the message arguments
* @return scala type for message processing
*/
private static Buffer<Object> convertArgsToScalaBuffer(final Object... args) {
return scala.collection.JavaConverters.asScalaBufferConverter(wrapArgsToListIfNeeded(args)).asScala();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Converts a Java List to Scala Seq.
*/
public static <T> scala.collection.Seq<T> toSeq(java.util.List<T> list) {
return scala.collection.JavaConverters.asScalaBufferConverter(list).asScala().toList();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Converts the varargs to a scala buffer,
* takes care of wrapping varargs into a intermediate list if necessary
*
* @param args the message arguments
* @return scala type for message processing
*/
private static Buffer<Object> convertArgsToScalaBuffer(final Object... args) {
return scala.collection.JavaConverters.asScalaBufferConverter(wrapArgsToListIfNeeded(args)).asScala();
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Converts the varargs to a scala buffer,
* takes care of wrapping varargs into a intermediate list if necessary
*
* @param args the message arguments
* @return scala type for message processing
*/
private static Seq<Object> convertArgsToScalaBuffer(final Object... args) {
return scala.collection.JavaConverters.asScalaBufferConverter(wrapArgsToListIfNeeded(args)).asScala().toList();
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* Converts the varargs to a scala buffer,
* takes care of wrapping varargs into a intermediate list if necessary
*
* @param args the message arguments
* @return scala type for message processing
*/
private static Seq<Object> convertArgsToScalaBuffer(final Object... args) {
return scala.collection.JavaConverters.asScalaBufferConverter(wrapArgsToListIfNeeded(args)).asScala().toList();
}
代码示例来源:origin: com.typesafe.play/play
/**
* Converts the varargs to a scala buffer,
* takes care of wrapping varargs into a intermediate list if necessary
*
* @param args the message arguments
* @return scala type for message processing
*/
private static Seq<Object> convertArgsToScalaBuffer(final Object... args) {
return scala.collection.JavaConverters.asScalaBufferConverter(wrapArgsToListIfNeeded(args)).asScala().toList();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Translates the first defined message.
*
* Uses `java.text.MessageFormat` internally to format the message.
*
* @param lang the message lang
* @param keys the messages keys
* @param args the message arguments
* @return the formatted message or a default rendering if the key wasn't defined
*/
public String get(play.api.i18n.Lang lang, List<String> keys, Object... args) {
Buffer<String> keyArgs = scala.collection.JavaConverters.asScalaBufferConverter(keys).asScala();
Buffer<Object> scalaArgs = convertArgsToScalaBuffer(args);
return messages.apply(keyArgs.toSeq(), scalaArgs, lang);
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Translates the first defined message.
*
* Uses `java.text.MessageFormat` internally to format the message.
*
* @param lang the message lang
* @param keys the messages keys
* @param args the message arguments
* @return the formatted message or a default rendering if the key wasn't defined
*/
public String get(play.api.i18n.Lang lang, List<String> keys, Object... args) {
Buffer<String> keyArgs = scala.collection.JavaConverters.asScalaBufferConverter(keys).asScala();
Seq<Object> scalaArgs = convertArgsToScalaBuffer(args);
return messages.apply(keyArgs.toSeq(), scalaArgs, lang);
}
代码示例来源:origin: com.typesafe.play/play
/**
* Translates the first defined message.
*
* Uses `java.text.MessageFormat` internally to format the message.
*
* @param lang the message lang
* @param keys the messages keys
* @param args the message arguments
* @return the formatted message or a default rendering if the key wasn't defined
*/
public String get(play.api.i18n.Lang lang, List<String> keys, Object... args) {
Buffer<String> keyArgs = scala.collection.JavaConverters.asScalaBufferConverter(keys).asScala();
Seq<Object> scalaArgs = convertArgsToScalaBuffer(args);
return messages.apply(keyArgs.toSeq(), scalaArgs, lang);
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* Translates the first defined message.
*
* Uses `java.text.MessageFormat` internally to format the message.
*
* @param lang the message lang
* @param keys the messages keys
* @param args the message arguments
* @return the formatted message or a default rendering if the key wasn't defined
*/
public String get(play.api.i18n.Lang lang, List<String> keys, Object... args) {
Buffer<String> keyArgs = scala.collection.JavaConverters.asScalaBufferConverter(keys).asScala();
Seq<Object> scalaArgs = convertArgsToScalaBuffer(args);
return messages.apply(keyArgs.toSeq(), scalaArgs, lang);
}
代码示例来源:origin: com.sandinh/play-alone
/**
* Converts a Java List to Scala Seq.
*/
public static <T> scala.collection.Seq<T> toSeq(java.util.List<T> list) {
return scala.collection.JavaConverters.asScalaBufferConverter(list).asScala().toList();
}
代码示例来源:origin: org.openkoreantext/open-korean-text
/**
* Detokenize the input list of words.
*
* @param tokens List of words.
* @return Detokenized string.
*/
public static String detokenize(List<String> tokens) {
return OpenKoreanTextProcessor.detokenize(JavaConverters.asScalaBufferConverter(tokens).asScala());
}
代码示例来源:origin: org.openkoreantext/open-korean-text
/**
* Add user-defined words to the noun dictionary. Spaced words are ignored.
*
* @param words List of user nouns.
*/
public static void addNounsToDictionary(List<String> words) {
OpenKoreanTextProcessor.addNounsToDictionary(JavaConverters.asScalaBufferConverter(words).asScala());
}
代码示例来源:origin: com.cerner.beadledom/beadledom-swagger
@Override
public scala.collection.immutable.List<Class<?>> classesFromContext(
Application app, ServletConfig sc) {
List<Class<?>> classes = Lists.newArrayList();
addJaxrsClasses(injector, classes);
return JavaConverters.asScalaBufferConverter(classes).asScala().toList();
}
代码示例来源:origin: com.cerner.beadledom/beadledom-swagger1
@Override
public scala.collection.immutable.List<Class<?>> classesFromContext(
Application app, ServletConfig sc) {
List<Class<?>> classes = Lists.newArrayList();
addJaxrsClasses(injector, classes);
return JavaConverters.asScalaBufferConverter(classes).asScala().toList();
}
代码示例来源:origin: org.openkoreantext/open-korean-text
/**
* Remove user-defined word List from the dictionary for the specified KoreanPos.
*
* @param pos KoreanPos of words to add.
* @param words Sequence of words to add.
*/
public static void removeWordFromDictionary(KoreanPosJava pos, List<String> words) {
OpenKoreanTextProcessor.removeWordsFromDictionary(KoreanPos.withName(pos.toString()), JavaConverters.asScalaBufferConverter(words).asScala());
}
代码示例来源:origin: org.openkoreantext/open-korean-text
/**
* Add user-defined word List to the dictionary for the specified KoreanPos.
*
* @param pos KoreanPos of words to add.
* @param words Sequence of words to add.
*/
public static void addWordsToDictionary(KoreanPosJava pos, List<String> words) {
OpenKoreanTextProcessor.addWordsToDictionary(KoreanPos.withName(pos.toString()), JavaConverters.asScalaBufferConverter(words).asScala());
}
内容来源于网络,如有侵权,请联系作者删除!