本文整理了Java中play.libs.F.Some()
方法的一些代码示例,展示了F.Some()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。F.Some()
方法的具体详情如下:
包路径:play.libs.F
类名称:F
方法名:Some
[英]Construct a Some
value.
[中]构造一个Some
值。
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Constructs a right side of the disjoint union, as opposed to the Left side.
*
* @param value The value of the right side
* @return A right sided disjoint union
*/
public static <A, B> Either<A, B> Right(B value) {
return new Either<A, B>(None(), Some(value));
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Constructs a left side of the disjoint union, as opposed to the Right side.
*
* @param value The value of the left side
* @return A left sided disjoint union
*/
public static <A, B> Either<A, B> Left(A value) {
return new Either<A, B>(Some(value), None());
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B> Either<A, B> _2(B value) {
return new Either(None, Some(value));
}
代码示例来源:origin: com.typesafe.play/play-java_2.10
/**
* Populates this form with an existing value, used for edit forms.
*
* @param value existing value of type <code>T</code> used to fill this form
* @return a copy of this form filled with the new data
*/
@SuppressWarnings("unchecked")
public Form<T> fill(T value) {
if(value == null) {
throw new RuntimeException("Cannot fill a form with a null value");
}
return new Form(rootName, backedType, new HashMap<String,String>(), new HashMap<String,ValidationError>(), Some(value), groups);
}
代码示例来源:origin: play/play-java
/**
* Populates this form with an existing value, used for edit forms.
*
* @param value existing value of type <code>T</code> used to fill this form
* @return a copy of this form filled with the new data
*/
@SuppressWarnings("unchecked")
public Form<T> fill(T value) {
if(value == null) {
throw new RuntimeException("Cannot fill a form with a null value");
}
return new Form(rootName, backedType, new HashMap<String,String>(), new HashMap<String,ValidationError>(), Some(value), groups);
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B> Either<A, B> _1(A value) {
return new Either(Some(value), None);
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B, C> E3<A, B, C> _1(A value) {
return new E3(Some(value), None, None);
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B, C> E3<A, B, C> _2(B value) {
return new E3(None, Some(value), None);
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B, C, D> E4<A, B, C, D> _2(B value) {
return new E4(None, Some(value), None, None);
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B, C> E3<A, B, C> _3(C value) {
return new E3(None, None, Some(value));
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B, C, D> E4<A, B, C, D> _3(C value) {
return new E4(None, None, Some(value), None);
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public static <A, B, C, D> E4<A, B, C, D> _4(D value) {
return new E4(None, None, None, Some(value));
}
代码示例来源:origin: play/play-java
return new Form(rootName, backedType, new HashMap<String,String>(data), new HashMap<String,List<ValidationError>>(errors), Some((T)result.getTarget()), groups);
代码示例来源:origin: com.typesafe.play/play-java_2.10
return new Form(rootName, backedType, data, errors, Some((T)result.getTarget()), groups);
} else {
Object globalError = null;
errors = (Map<String,List<ValidationError>>)globalError;
return new Form(rootName, backedType, data, errors, Some((T)result.getTarget()), groups);
return new Form(rootName, backedType, new HashMap<String,String>(data), new HashMap<String,List<ValidationError>>(errors), Some((T)result.getTarget()), groups);
内容来源于网络,如有侵权,请联系作者删除!