当前位置: 首页>>代码示例>>Java>>正文


Java StringValue.valueOf方法代码示例

本文整理汇总了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();
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:19,代码来源:HistoricProjectPage.java

示例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();
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:19,代码来源:BaseTreePage.java

示例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();
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:19,代码来源:QMBaseTreePage.java

示例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;
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:9,代码来源:StreamClient.java

示例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;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:40,代码来源:ArtifactoryWebRequest.java

示例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();
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:9,代码来源:ArtifactoryWebRequest.java

示例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);
}
 
开发者ID:l0rdn1kk0n,项目名称:wicket-clientside-logging,代码行数:10,代码来源:Mocks.java

示例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);
}
 
开发者ID:l0rdn1kk0n,项目名称:wicket-clientside-logging,代码行数:17,代码来源:ClientSideLogObject.java


注:本文中的org.apache.wicket.util.string.StringValue.valueOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。