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

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

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

Scala.toSeq介绍

[英]Converts a Java List to Scala Seq.
[中]将Java列表转换为Scala Seq。

代码示例

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

path,
classloader,
Scala.toSeq(additionalPlugins),
Scala.toSeq(withoutPlugins),
Scala.asScala((Map<String, Object>) additionalConfiguration),
scala.Option.apply(scalaGlobal),

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

/**
 * @param <T> the type parameter
 * @return an empty Scala Seq.
 */
@SuppressWarnings("unchecked")
public static <T> scala.collection.Seq<T> emptySeq() {
  return (scala.collection.Seq<T>) toSeq(new Object[]{});
}

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

/**
 * @param <T> the type parameter
 * @return an empty Scala Seq.
 */
@SuppressWarnings("unchecked")
public static <T> scala.collection.Seq<T> emptySeq() {
  return (scala.collection.Seq<T>) toSeq(new Object[]{});
}

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

/**
 * @param <T> the type parameter
 * @return an empty Scala Seq.
 */
@SuppressWarnings("unchecked")
public static <T> scala.collection.Seq<T> emptySeq() {
  return (scala.collection.Seq<T>) toSeq(new Object[]{});
}

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

/**
 * Creates an empty Scala Seq.
 */
@SuppressWarnings("unchecked")
public static <T> scala.collection.Seq<T> emptySeq() {
  return (scala.collection.Seq<T>)toSeq(new Object[] {});
}

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

/**
 * Converts a Java Array to Scala Seq.
 */
public static <T> scala.collection.Seq<T> toSeq(T[] array) {
  return toSeq(java.util.Arrays.asList(array));
}

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

/**
 * Converts a Java varargs to Scala Seq.
 */
public static <T> scala.collection.Seq<T> varargs(T... array) {
  return toSeq(java.util.Arrays.asList(array));
}

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

protected HttpErrorHandler preferred(Http.RequestHeader request) {
  String preferredContentType = Scala.orNull(MediaRange.preferred(
      Scala.toSeq(request.acceptedTypes()),
      Scala.toSeq(errorHandlerMap.keySet().toArray(new String[]{}))
  ));
  if (preferredContentType == null) {
    return errorHandlerMap.values().iterator().next();
  } else {
    return errorHandlerMap.get(preferredContentType);
  }
}

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

protected HttpErrorHandler preferred(Http.RequestHeader request) {
  String preferredContentType = Scala.orNull(MediaRange.preferred(
      Scala.toSeq(request.acceptedTypes()),
      Scala.toSeq(errorHandlerMap.keySet().toArray(new String[]{}))
  ));
  if (preferredContentType == null) {
    return errorHandlerMap.values().iterator().next();
  } else {
    return errorHandlerMap.get(preferredContentType);
  }
}

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

protected HttpErrorHandler preferred(Http.RequestHeader request) {
  String preferredContentType = Scala.orNull(MediaRange.preferred(
      Scala.toSeq(request.acceptedTypes()),
      Scala.toSeq(errorHandlerMap.keySet().toArray(new String[]{}))
  ));
  if (preferredContentType == null) {
    return errorHandlerMap.values().iterator().next();
  } else {
    return errorHandlerMap.get(preferredContentType);
  }
}

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

/**
 * Guess the preferred lang in the langs set passed as argument.
 * The first Lang that matches an available Lang wins, otherwise returns the first Lang available in this application.
 */
public static Lang preferred(List<Lang> langs) {
  List<play.api.i18n.Lang> result = new ArrayList<play.api.i18n.Lang>();
  for(play.i18n.Lang lang: langs) {
    result.add(lang.underlyingLang);
  }
  return new Lang(play.api.i18n.Lang.preferred(Scala.toSeq(result), play.api.Play.current()));
}

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

/**
   * Guess the preferred lang in the langs set passed as argument.
   * The first Lang that matches an available Lang wins, otherwise returns the first Lang available in this application.
   *
   * @param app the currept application
   * @param availableLangs the set of langs from which to guess the preferred
   * @return the preferred lang.
   */
  public static Lang preferred(Application app, List<Lang> availableLangs) {
    play.api.i18n.Langs langs = app.injector().instanceOf(play.api.i18n.Langs.class);
    Stream<Lang> stream = availableLangs.stream();
    List<play.api.i18n.Lang> langSeq = stream.map(l -> new play.api.i18n.Lang(l.toLocale())).collect(toList());
    return new Lang(langs.preferred(Scala.toSeq(langSeq)));
  }
}

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

/**
   * Guess the preferred lang in the langs set passed as argument.
   * The first Lang that matches an available Lang wins, otherwise returns the first Lang available in this application.
   *
   * @param app the currept application
   * @param availableLangs the set of langs from which to guess the preferred
   * @return the preferred lang.
   */
  public static Lang preferred(Application app, List<Lang> availableLangs) {
    play.api.i18n.Langs langs = app.injector().instanceOf(play.api.i18n.Langs.class);
    Stream<Lang> stream = availableLangs.stream();
    List<play.api.i18n.Lang> langSeq = stream.map(l -> new play.api.i18n.Lang(l.toLocale())).collect(toList());
    return new Lang(langs.preferred(Scala.toSeq(langSeq)));
  }
}

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

/**
 * Returns a new flash with the given keys removed.
 */
public Flash removing(String... keys) {
  return new play.api.mvc.Flash(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava();
}

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

/**
 * Returns a new session with the given keys removed.
 */
public Session removing(String... keys) {
  return new play.api.mvc.Session(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava();
}

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

/**
 * Returns a new session with the given keys removed.
 */
public Session removing(String... keys) {
  return new play.api.mvc.Session(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava();
}

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

/**
 * Returns a new session with the given keys removed.
 */
public Session removing(String... keys) {
  return new play.api.mvc.Session(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava();
}

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

/**
 * Returns a new flash with the given keys removed.
 */
public Flash removing(String... keys) {
  return new play.api.mvc.Flash(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava();
}

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

/**
 * Returns a new flash with the given keys removed.
 */
public Flash removing(String... keys) {
  return new play.api.mvc.Flash(Scala.asScala(this)).$minus$minus(Scala.toSeq(keys)).asJava();
}

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

/**
 * Generates a JavaScript router.
 */
public static JavaScript javascriptRouter(String name, String ajaxMethod, play.api.routing.JavaScriptReverseRoute... routes) {
  return play.api.Routes.javascriptRouter(
    name, Scala.Option(ajaxMethod), play.mvc.Http.Context.current().request().host(), Scala.toSeq(routes)
  );
}

相关文章