本文整理了Java中play.libs.F.Tuple()
方法的一些代码示例,展示了F.Tuple()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。F.Tuple()
方法的具体详情如下:
包路径:play.libs.F
类名称:F
方法名:Tuple
[英]Constructs a tuple of A,B
[中]构造a,B的元组
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* Converts a scala {@code Tuple2} to a java F.Tuple.
*
* @param tuple the Scala Tuple.
* @param <A> input parameter type
* @param <B> return type.
* @return an instance of Tuple with the elements.
*/
public static <A, B> F.Tuple<A, B> asJava(scala.Tuple2<A, B> tuple) {
return F.Tuple(tuple._1(), tuple._2());
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Converts a scala {@code Tuple2} to a java F.Tuple.
*
* @param tuple the Scala Tuple.
* @param <A> input parameter type
* @param <B> return type.
* @return an instance of Tuple with the elements.
*/
public static <A, B> F.Tuple<A, B> asJava(scala.Tuple2<A, B> tuple) {
return F.Tuple(tuple._1(), tuple._2());
}
代码示例来源:origin: com.typesafe.play/play
/**
* Converts a scala {@code Tuple2} to a java F.Tuple.
*
* @param tuple the Scala Tuple.
* @param <A> input parameter type
* @param <B> return type.
* @return an instance of Tuple with the elements.
*/
public static <A, B> F.Tuple<A, B> asJava(scala.Tuple2<A, B> tuple) {
return F.Tuple(tuple._1(), tuple._2());
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Convert a scala Tuple2 to a java F.Tuple.
*/
public static <A, B> F.Tuple<A, B> asJava(scala.Tuple2<A, B> tuple) {
return F.Tuple(tuple._1(), tuple._2());
}
代码示例来源:origin: com.typesafe.play/play-java-forms
@Override
public Tuple<String, Object[]> getErrorMessageKey() {
return Tuple(message, new Object[] { regex });
}
代码示例来源:origin: com.typesafe.play/play-java-forms_2.12
@Override
public Tuple<String, Object[]> getErrorMessageKey() {
return Tuple(message, new Object[] { regex });
}
代码示例来源:origin: com.typesafe.play/play-java-forms
public Tuple<String, Object[]> getErrorMessageKey() {
return Tuple(message, new Object[] {});
}
代码示例来源:origin: com.typesafe.play/play-java-forms
@SuppressWarnings("unchecked")
public Tuple<String, Object[]> getErrorMessageKey() {
Tuple<String, Object[]> errorMessageKey = null;
try {
errorMessageKey = validator.getErrorMessageKey();
} catch(Exception e) {
throw new RuntimeException(e);
}
return (errorMessageKey != null) ? errorMessageKey : Tuple(defaultMessage, new Object[] {});
}
代码示例来源:origin: com.typesafe.play/play-java-forms_2.11
@SuppressWarnings("unchecked")
public Tuple<String, Object[]> getErrorMessageKey() {
Tuple<String, Object[]> errorMessageKey = null;
try {
errorMessageKey = validator.getErrorMessageKey();
} catch(Exception e) {
throw new RuntimeException(e);
}
return (errorMessageKey != null) ? errorMessageKey : Tuple(defaultMessage, new Object[] {});
}
代码示例来源:origin: com.typesafe.play/play-java-forms
@SuppressWarnings("unchecked")
public Tuple<String, Object[]> getErrorMessageKey() {
Tuple<String, Object[]> errorMessageKey = null;
try {
errorMessageKey = validator.getErrorMessageKey();
} catch(Exception e) {
throw new RuntimeException(e);
}
return (errorMessageKey != null) ? errorMessageKey : Tuple(defaultMessage, new Object[] {});
}
代码示例来源:origin: com.typesafe.play/play-java-forms_2.12
@SuppressWarnings("unchecked")
public Tuple<String, Object[]> getErrorMessageKey() {
Tuple<String, Object[]> errorMessageKey = null;
try {
errorMessageKey = validator.getErrorMessageKey();
} catch(Exception e) {
throw new RuntimeException(e);
}
return (errorMessageKey != null) ? errorMessageKey : Tuple(defaultMessage, new Object[] {});
}
代码示例来源:origin: com.typesafe.play/play-java-forms_2.12
@SuppressWarnings("unchecked")
public Tuple<String, Object[]> getErrorMessageKey() {
Tuple<String, Object[]> errorMessageKey = null;
try {
errorMessageKey = validator.getErrorMessageKey();
} catch(Exception e) {
throw new RuntimeException(e);
}
return (errorMessageKey != null) ? errorMessageKey : Tuple(defaultMessage, new Object[] {});
}
代码示例来源:origin: be.objectify/deadbolt-java_2.12
public CompletionStage<F.Tuple<Optional<Result>, Http.RequestHeader>> preAuth(final boolean forcePreAuthCheck,
final Http.RequestHeader request,
final Optional<String> content,
final DeadboltHandler deadboltHandler)
{
return forcePreAuthCheck ? beforeAuthCheckCache.apply(deadboltHandler, request, content)
: CompletableFuture.completedFuture(F.Tuple(Optional.empty(), request));
}
代码示例来源:origin: com.typesafe.play/play-java-forms_2.12
/**
* Converts a constraint to a human-readable value.
*
* @param constraint the constraint descriptor.
* @return A tuple containing the constraint's display name and the constraint attributes.
*/
public static Tuple<String,List<Object>> displayableConstraint(ConstraintDescriptor<?> constraint) {
final Display displayAnnotation = constraint.getAnnotation().annotationType().getAnnotation(Display.class);
return Tuple(displayAnnotation.name(), Collections.unmodifiableList(Stream.of(displayAnnotation.attributes()).map(attr -> constraint.getAttributes().get(attr)).collect(Collectors.toList())));
}
代码示例来源:origin: com.typesafe.play/play-java-forms_2.11
/**
* Converts a constraint to a human-readable value.
*
* @param constraint the constraint descriptor.
* @return A tuple containing the constraint's display name and the constraint attributes.
*/
public static Tuple<String,List<Object>> displayableConstraint(ConstraintDescriptor<?> constraint) {
final Display displayAnnotation = constraint.getAnnotation().annotationType().getAnnotation(Display.class);
return Tuple(displayAnnotation.name(), Collections.unmodifiableList(Stream.of(displayAnnotation.attributes()).map(attr -> constraint.getAttributes().get(attr)).collect(Collectors.toList())));
}
代码示例来源:origin: com.typesafe.play/play-java-forms
/**
* Converts a constraint to a human-readable value.
*
* @param constraint the constraint descriptor.
* @return A tuple containing the constraint's display name and the constraint attributes.
*/
public static Tuple<String,List<Object>> displayableConstraint(ConstraintDescriptor<?> constraint) {
final Display displayAnnotation = constraint.getAnnotation().annotationType().getAnnotation(Display.class);
return Tuple(displayAnnotation.name(), Collections.unmodifiableList(Stream.of(displayAnnotation.attributes()).map(attr -> constraint.getAttributes().get(attr)).collect(Collectors.toList())));
}
代码示例来源:origin: com.sandinh/play-alone
/**
* Convert a scala Tuple2 to a java F.Tuple.
*/
public static <A, B> F.Tuple<A, B> asJava(scala.Tuple2<A, B> tuple) {
return F.Tuple(tuple._1(), tuple._2());
}
代码示例来源:origin: be.objectify/deadbolt-java_2.11
default Constraint or(final Constraint other)
{
Objects.requireNonNull(other);
return (rh, handler, global, fMeta) ->
test(rh, handler, global, fMeta).thenCompose(passed1 -> passed1._1 ? CompletableFuture.completedFuture(F.Tuple(true, passed1._2))
: other.test(passed1._2, handler, global, fMeta).thenApply(passed2 -> passed2));
}
}
代码示例来源:origin: be.objectify/deadbolt-java_2.11
default Constraint and(final Constraint other)
{
Objects.requireNonNull(other);
return (rh, handler, global, fMeta) ->
test(rh, handler, global, fMeta).thenCompose(passed1 -> passed1._1 ? other.test(passed1._2, handler, global, fMeta).thenApply(passed2 -> passed2)
: CompletableFuture.completedFuture(F.Tuple(false, passed1._2)));
}
代码示例来源:origin: be.objectify/deadbolt-java_2.12
default Constraint or(final Constraint other)
{
Objects.requireNonNull(other);
return (rh, handler, global, fMeta) ->
test(rh, handler, global, fMeta).thenCompose(passed1 -> passed1._1 ? CompletableFuture.completedFuture(F.Tuple(true, passed1._2))
: other.test(passed1._2, handler, global, fMeta).thenApply(passed2 -> passed2));
}
}
内容来源于网络,如有侵权,请联系作者删除!