本文整理汇总了Java中org.apache.wicket.util.string.StringValue.valueOf方法的典型用法代码示例。如果您正苦于以下问题:Java StringValue.valueOf方法的具体用法?Java StringValue.valueOf怎么用?Java StringValue.valueOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.string.StringValue
的用法示例。
在下文中一共展示了StringValue.valueOf方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequestedNodeId
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
protected Long getRequestedNodeId() {
StringValue id = getPageParameters().get("id");
if (id.isEmpty()) {
String key = getPageParameters().get("project-key")
.toOptionalString();
if (key != null) {
ITreeNode<String> node = treeNodeService
.getTreeNodeByKey(key);
if (node != null) {
id = StringValue.valueOf(node.getId());
} else {
// TODO give translated message for the 404 reason
throw new AbortWithHttpErrorCodeException(404);
}
}
}
return id.toOptionalLong();
}
示例2: getRequestedNodeId
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
private Long getRequestedNodeId() {
StringValue id = getPageParameters().get("id");
if (id.isEmpty()) {
String key = getPageParameters().get("project-key")
.toOptionalString();
if (key != null) {
ITreeNode<String> node = treeNodeService
.getTreeNodeByKey(key);
if (node != null) {
id = StringValue.valueOf(node.getId());
} else {
// TODO give translated message for the 404 reason
throw new AbortWithHttpErrorCodeException(404);
}
}
}
return id.toOptionalLong();
}
示例3: getRequestedNodeId
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
private Long getRequestedNodeId() {
StringValue id = getPageParameters().get("id");
if (id.isEmpty()) {
String key = getPageParameters().get("qmodel-key")
.toOptionalString();
if (key != null) {
IQMTreeNode<String> node = qmtreeNodeService
.getTreeNodeByKey(key);
if (node != null) {
id = StringValue.valueOf(node.getId());
} else {
// TODO give translated message for the 404 reason
throw new AbortWithHttpErrorCodeException(404);
}
}
}
return id.toOptionalLong();
}
示例4: setScope
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public void setScope(String scope) {
this.scope = scope;
StringValue scn = StringValue.valueOf(scope);
long rId = scn.toLong(Long.MIN_VALUE);
if (rId > 0) {
this.roomId = rId;
}
}
示例5: generatePostParameters
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
protected Map<String, List<StringValue>> generatePostParameters() {
Map<String, List<StringValue>> postParameters = new HashMap<>();
IRequestParameters queryParams = getQueryParameters();
@SuppressWarnings("unchecked")
Map<String, String[]> params = getContainerRequest().getParameterMap();
for (Map.Entry<String, String[]> param : params.entrySet()) {
final String name = param.getKey();
final String[] values = param.getValue();
// build a mutable list of query params that have the same name as the post param
List<StringValue> queryValues = queryParams.getParameterValues(name);
if (queryValues == null) {
queryValues = Collections.emptyList();
} else {
queryValues = new ArrayList<>(queryValues);
}
// the list that will contain accepted post param values
List<StringValue> postValues = new ArrayList<>();
for (String value : values) {
StringValue val = StringValue.valueOf(value);
if (queryValues.contains(val)) {
// if a query param with this value exists remove it and continue
queryValues.remove(val);
} else {
// there is no query param with this value, assume post
postValues.add(val);
}
}
if (!postValues.isEmpty()) {
postParameters.put(name, postValues);
}
}
return postParameters;
}
示例6: getParameterValue
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public StringValue getParameterValue(String name) {
List<StringValue> values = getPostRequestParameters().get(name);
if (values == null || values.isEmpty()) {
return StringValue.valueOf((String) null);
} else {
return values.iterator().next();
}
}
示例7: createClientSideLogObject
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public static ClientSideLogObject createClientSideLogObject() {
return new ClientSideLogObject(StringValue.valueOf("error"),
StringValue.valueOf("message"),
StringValue.valueOf(1234),
StringValue.valueOf("file"),
StringValue.valueOf("line"),
StringValue.valueOf("stacktrace"),
0);
}
示例8: ClientSideLogObject
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
/**
* Construct.
*
* @param lvl the log level as {@link StringValue}
* @param message the message as {@link StringValue}
* @param timestamp the timestamp as {@link StringValue} in UTC format.
* @param file the file that has thrown this error
* @param line the line in file that has thrown this error
* @param stacktrace the client side stacktrace
* @param index the parameter index that was used on client side to generate this log object
*/
public ClientSideLogObject(String lvl, String message, long timestamp, String file, String line,
String stacktrace, int index) {
this(StringValue.valueOf(lvl), StringValue.valueOf(message), StringValue.valueOf(timestamp),
StringValue.valueOf(file), StringValue.valueOf(line), StringValue.valueOf(stacktrace), index);
}