本文整理汇总了Java中org.apache.wicket.util.string.StringValue.toLong方法的典型用法代码示例。如果您正苦于以下问题:Java StringValue.toLong方法的具体用法?Java StringValue.toLong怎么用?Java StringValue.toLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.string.StringValue
的用法示例。
在下文中一共展示了StringValue.toLong方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CustomerEditPage
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public CustomerEditPage(PageParameters params){
super();
StringValue customerIdParam = params.get(CUSTOMER_ID_PARAM);
if(customerIdParam.isEmpty() || !StringUtils.isNumeric(customerIdParam.toString())){
getSession().error(MessageFormat.format(getString("param.customer.id.missing"), customerIdParam));
// "Missing customer id " + stringValue
setResponsePage(CustomerListPage.class);
}
Long customerId = customerIdParam.toLong();
Customer customer = service.findById(customerId);
if(customer == null){
getSession().error(MessageFormat.format(getString("customer.not-found"), customerId.toString()));
setResponsePage(CustomerListPage.class);
}
StringValue pageReferfenceIdParam = params.get(PAGE_REFERENCE_ID);
if(!pageReferfenceIdParam.isEmpty() || StringUtils.isNumeric(pageReferfenceIdParam.toString())){
setPageReferenceId(pageReferfenceIdParam.toInteger());
}
getCustomerModel().setObject(customer);
}
示例2: fromParameters
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
@Override
public SearchContext fromParameters(PageParameters params) {
final StringValue indexParam = params.get(VloWebAppParameters.SEARCH_INDEX);
final StringValue countParam = params.get(VloWebAppParameters.SEARCH_COUNT);
final QueryFacetsSelection selection = selectionConverter.fromParameters(params);
if (!indexParam.isEmpty() && !countParam.isEmpty() && selection != null) {
try {
return new SearchContextModel(indexParam.toLong(), countParam.toLong(), Model.of(selection));
} catch (StringValueConversionException ex) {
logger.warn("Illegal query parameter value", ex);
}
}
return null;
}
示例3: 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;
}
}
示例4: getProjectFromParameters
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
private Project getProjectFromParameters(StringValue projectParam)
{
Project project = null;
if (projectParam != null && !projectParam.isEmpty()) {
long projectId = projectParam.toLong();
project = projectService.getProject(projectId);
}
return project;
}
示例5: getDocumentFromParameters
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
private SourceDocument getDocumentFromParameters(Project aProject, StringValue documentParam)
{
SourceDocument document = null;
if (documentParam != null && !documentParam.isEmpty()) {
long documentId = documentParam.toLong();
document = documentService.getSourceDocument(aProject.getId(), documentId);
}
return document;
}
示例6: getAsLong
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public static Long getAsLong(final PageParameters parameters, final String name)
{
final StringValue sval = parameters.get(name);
if (sval == null || sval.isNull() == true) {
return null;
} else {
return sval.toLong();
}
}