本文整理汇总了Java中org.apache.wicket.util.lang.Args.isTrue方法的典型用法代码示例。如果您正苦于以下问题:Java Args.isTrue方法的具体用法?Java Args.isTrue怎么用?Java Args.isTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.lang.Args
的用法示例。
在下文中一共展示了Args.isTrue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setComponentToRefresh
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
public void setComponentToRefresh(MarkupContainer component) {
Args.isTrue(
component == this || component.contains(this, true),
"The component to refresh in stead of a DataTable must contain the DataTable. {} does not contain {}",
component, this
);
this.componentToRefresh = component;
this.componentToRefresh.setOutputMarkupId(true);
}
示例2: createLinksForDocuments
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private void createLinksForDocuments(List<ODocument> documents, List<ODocument> links) {
Args.isTrue(documents.size() == links.size(), "documents.size() == linkedDocs.size()");
for (int i = 0; i < documents.size(); i++) {
ODocument document = documents.get(i);
document.field(LINK_FIELD, links.get(i).getIdentity().toString(), OType.LINK);
document.save();
}
}
示例3: createEmbeddedFieldsForDocuments
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private void createEmbeddedFieldsForDocuments(List<ODocument> documents, List<ODocument> embedded) {
Args.isTrue(documents.size() == embedded.size(), "documents.size() == embedded.size()");
for (int i = 0; i < documents.size(); i++) {
ODocument document = documents.get(i);
document.field(EMBEDDED_FIELD, embedded.get(i), OType.EMBEDDED);
document.save();
}
}
示例4: createEmbeddedStringCollectionForDocuments
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private void createEmbeddedStringCollectionForDocuments(List<ODocument> documents, List<String> strings, boolean list) {
Args.isTrue(documents.size() == strings.size(), "documents.size() == strings.size()");
String field = list ? EMBEDDED_LIST_STRING_FIELD : EMBEDDED_SET_STRING_FIELD;
for (int i = 0; i < documents.size(); i++) {
ODocument document = documents.get(i);
document.field(field, strings.get(i));
document.save();
}
}
示例5: createEmbeddedCollectionFieldsForDocuments
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private void createEmbeddedCollectionFieldsForDocuments(List<ODocument> documents, List<List<ODocument>> embeddedList, boolean list) {
Args.isTrue(documents.size() == embeddedList.size(), "documents.size() == embeddedList.size()");
String field = list ? EMBEDDED_LIST_FIELD : EMBEDDED_SET_FIELD;
for (int i = 0; i < documents.size(); i++) {
ODocument document = documents.get(i);
document.field(field, embeddedList.get(i), OType.EMBEDDEDLIST);
document.save();
}
}
示例6: createLinkListForDocument
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private void createLinkListForDocument(List<ODocument> documents, List<List<ODocument>> linkList) {
Args.isTrue(documents.size() == linkList.size(), "documents.size() == linkList.size()");
for (int i = 0; i < documents.size(); i++) {
ODocument document = documents.get(i);
document.field(LINK_LIST_FIELD, linkList.get(i), OType.LINKLIST);
document.save();
}
}
示例7: createMapDocsForDocuments
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private void createMapDocsForDocuments(List<ODocument> documents, List<ODocument> mapDocs, boolean embedded) {
Args.isTrue(documents.size() == mapDocs.size(), "documents.size() == mapDocs.size()");
for (int i = 0; i < documents.size(); i++) {
ODocument document = documents.get(i);
Map<String, ODocument> map = Maps.newHashMap();
map.put(MAP_KEYS.get(i), mapDocs.get(i));
if (embedded) {
document.field(EMBEDDED_MAP_FIELD, map, OType.EMBEDDEDMAP);
} else document.field(LINK_MAP_FIELD, map, OType.LINKMAP);
document.save();
}
}
示例8: createListOfDocuments
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
private List<ODocument> createListOfDocuments(List<ODocument> docs, List<Integer> order) {
Args.isTrue(docs.size() == order.size(), "docs.size() == order.size()");
List<ODocument> documents = Lists.newArrayList();
for (Integer i : order) {
documents.add(docs.get(i - 1));
}
return documents;
}
示例9: populateItem
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<AbstractLink> item) {
final AbstractLink link = item.getModelObject();
Args.isTrue(getButtonMarkupId().equals(link.getId()),
"component id is invalid, please use ButtonList.getButtonMarkupId()");
item.add(link);
}
示例10: testRequiredDefault
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
@MethodMapping(value = "/testreqdef", produces = RestMimeTypes.TEXT_PLAIN)
public String testRequiredDefault(
@RequestParam(value = "fromRequest", required = false) String request,
@CookieParam(value = "cookie", defaultValue = "true") boolean cookie,
@HeaderParam(value = "price", defaultValue = "12.6") float price,
@MatrixParam(parameterName = "matrixp", segmentIndex = 0, required = false, defaultValue = "0") int matrixp) {
Args.isTrue(request == null, "must be null!");
Args.isTrue(cookie, "must be true!");
Assert.assertEquals(Float.parseFloat("12.6"), price);
return "testRequiredDefault";
}
示例11: check
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
@Value.Check
public void check() {
Args.isTrue(getNorthEast().getLatitude() >= getSouthWest().getLatitude(), "North latitude must be greater than south latitude");
Args.isTrue(getNorthEast().getLongitude() >= getSouthWest().getLongitude(), "East longitude must be greater than west longitude");
}
示例12: check
import org.apache.wicket.util.lang.Args; //导入方法依赖的package包/类
@Value.Check
protected void check() {
Args.isTrue(getTopLeft().getX() <= getBottomRight().getX(), "X coordinate of topLeft must be less than or equal to X coordinate of bottomRight");
Args.isTrue(getTopLeft().getY() <= getBottomRight().getY(), "Y coordinate of topLeft must be less than or equal to Y coordinate of bottomRight");
}