org.apache.wicket.util.lang.Args.isTrue()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(29)

本文整理了Java中org.apache.wicket.util.lang.Args.isTrue()方法的一些代码示例,展示了Args.isTrue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Args.isTrue()方法的具体详情如下:
包路径:org.apache.wicket.util.lang.Args
类名称:Args
方法名:isTrue

Args.isTrue介绍

[英]Check if argument is true
[中]检查参数是否为真

代码示例

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

/**
 * Constructor with prepending icon and appending component.
 *
 * @param id               The component id
 * @param beforeIconType   The icon to use for the prepending addon
 * @param afterComponent   The component to use for the appending addon
 */
public AroundInputBorder(String id, IconType beforeIconType, Component afterComponent) {
  super(id, beforeIconType);
  Args.isTrue("after".equals(afterComponent.getId()), "The id of the 'after' component must be 'after'");
  addComponent(afterComponent);
}

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

/**
 * Constructor with prepending label and appending component.
 *
 * @param id              The component id
 * @param beforeLabel     The label to use for the prepending addon
 * @param afterComponent  The component to use for the appending addon
 */
public AroundInputBorder(String id, IModel<String> beforeLabel, Component afterComponent) {
  super(id, beforeLabel);
  Args.isTrue("after".equals(afterComponent.getId()), "The id of the 'after' component must be 'after'");
  addComponent(afterComponent);
}

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

/**
 * Constructor with two components.
 *
 * @param id               The component id
 * @param beforeComponent  The component to use for the prepending addon
 * @param afterComponent   The component to use for the appending addon
 */
public AroundInputBorder(String id, Component beforeComponent, Component afterComponent) {
  super(id, beforeComponent);
  Args.isTrue("after".equals(afterComponent.getId()), "The id of the 'after' component must be 'after'");
  addComponent(afterComponent);
}

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

/**
 * Construct.
 *
 * @param component the component to use inside navbar
 * @param position  the position inside navbar
 */
public ImmutableNavbarComponent(Component component, Navbar.ComponentPosition position) {
  super(position);
  Args.isTrue(Navbar.componentId().equals(component.getId()), "componentId must equal " + Navbar.componentId());
  this.component = component;
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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;
}

代码示例来源:origin: OrienteerBAP/Orienteer

/**
 * Convert JSON string with array of classes to {@link List}
 * @param json JSON string which contains JSON array of OrientDB classes.
 * @return list of {@link OArchitectOClass}
 * @throws IllegalArgumentException if json is not JSON array
 */
public static List<OArchitectOClass> fromJSON(String json) {
  Args.isTrue(json.startsWith("["), "Input JSON string is not array! json: " + json);
  List<OArchitectOClass> classes = Lists.newArrayList();
  JSONArray jsonArray = new JSONArray(json);
  for (int i = 0; i < jsonArray.length(); i++) {
    JSONObject jsonObject = jsonArray.getJSONObject(i);
    classes.add(convertOClassFromJson(jsonObject));
  }
  return classes;
}

代码示例来源:origin: org.apache.wicket/wicket-util

Args.isTrue(dir.isDirectory(), "Not a directory: '{}'", dir);

代码示例来源:origin: org.wicketstuff/wicketstuff-datatables

public Options lengthMenu(Integer[] values, String[] displayValues) {
  Args.notNull(values, "values");
  Args.notNull(displayValues, "displayValues");
  Args.isTrue(values.length == displayValues.length, "The values and display values length are different!");
  put(LengthMenu, new Object[][]{values, displayValues});
  return this;
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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();
  }
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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();
  }
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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();
  }
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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();
  }
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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();
  }
}

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

@Override
protected final WebMarkupContainer newButton(String markupId, IModel<String> labelModel, IModel<IconType> iconTypeModel) {
  Args.isTrue(btn == null, "btn was already set before.");
  btn = newBaseButton("button", labelModel, iconTypeModel);
  btn.setOutputMarkupId(true);
  caret = newCaret("caret");
  add(caret);
  return btn;
}

代码示例来源:origin: OrienteerBAP/wicket-orientdb

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();
  }
}

代码示例来源:origin: org.apache.wicket/wicket-util

Args.isTrue(dir.isDirectory(), "Not a directory: '{}'", dir);

代码示例来源:origin: apache/wicket

@Override
public Url encodePageParameters(PageParameters params)
{
  Args.notNull(params, "params");
  Args.isTrue(params.getIndexedCount() == 0,
    "This encoder does not support indexed page parameters. Specified parameters: %s",
    params);
  Url url = new Url();
  for (PageParameters.NamedPair pair : params.getAllNamed())
  {
    url.getSegments().add(pair.getKey());
    url.getSegments().add(pair.getValue());
  }
  return url;
}

代码示例来源:origin: org.apache.wicket/wicket-request

@Override
public Url encodePageParameters(PageParameters params)
{
  Args.notNull(params, "params");
  Args.isTrue(params.getIndexedCount() == 0,
    "This encoder does not support indexed page parameters. Specified parameters: %s",
    params);
  Url url = new Url();
  for (PageParameters.NamedPair pair : params.getAllNamed())
  {
    url.getSegments().add(pair.getKey());
    url.getSegments().add(pair.getValue());
  }
  return url;
}

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

@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);

    link.configure();
    if (!link.isEnabled()) {
      item.add(new CssClassNameAppender("disabled"));
    }
  }
}

相关文章

最新文章

更多