com.alibaba.citrus.util.Assert.assertNull()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(164)

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

Assert.assertNull介绍

[英]确保对象为空,否则抛出IllegalArgumentException
[中]确保对象为空,否则抛出IllegalArgumentException

代码示例

代码示例来源:origin: webx/citrus

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object) {
  return assertNull(object, null, null, (Object[]) null);
}

代码示例来源:origin: webx/citrus

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object, String message, Object... args) {
  return assertNull(object, null, message, args);
}

代码示例来源:origin: webx/citrus

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object) {
  return assertNull(object, null, null, (Object[]) null);
}

代码示例来源:origin: webx/citrus

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object, String message, Object... args) {
  return assertNull(object, null, message, args);
}

代码示例来源:origin: webx/citrus

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object) {
  return assertNull(object, null, null, (Object[]) null);
}

代码示例来源:origin: webx/citrus

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object, String message, Object... args) {
  return assertNull(object, null, message, args);
}

代码示例来源:origin: webx/citrus

private void assertNotRef() {
  assertNull(ref, UNSUPPORTED_OPERATION, "template ref");
}

代码示例来源:origin: webx/citrus

private void assertNotRef() {
  assertNull(ref, UNSUPPORTED_OPERATION, "template ref");
}

代码示例来源:origin: webx/citrus

private void assertNotRef() {
  assertNull(ref, UNSUPPORTED_OPERATION, "template ref");
}

代码示例来源:origin: webx/citrus

public void addSubElement(Element subElement) {
  assertNull(text, "text is not null");
  if (subElement != null) {
    subElements.add(subElement);
  }
}

代码示例来源:origin: webx/citrus

public void addSubElement(Element subElement) {
  assertNull(text, "text is not null");
  if (subElement != null) {
    subElements.add(subElement);
  }
}

代码示例来源:origin: webx/citrus

private void setSource(AttachmentSource source) {
  assertNull(this.source, ILLEGAL_STATE, "Attachment source already set: %s", this.source);
  this.source = assertNotNull(source, "source");
}

代码示例来源:origin: webx/citrus

private void setSource(AttachmentSource source) {
  assertNull(this.source, ILLEGAL_STATE, "Attachment source already set: %s", this.source);
  this.source = assertNotNull(source, "source");
}

代码示例来源:origin: webx/citrus

public Entry(String path, Schema schema) {
  this.path = assertNotNull(trimToNull(path), "path");
  this.directory = path.endsWith("/");
  int fromIndex = this.directory ? path.length() - 2 : path.length();
  this.name = path.substring(path.lastIndexOf("/", fromIndex) + 1);
  this.root = false;
  this.schema = schema;
  this.subEntries = createTreeMap();
  if (this.directory) {
    assertNull(schema, "schema");
  } else {
    assertNotNull(schema, "schema");
  }
}

代码示例来源:origin: webx/citrus

public Entry(String path, Schema schema) {
  this.path = assertNotNull(trimToNull(path), "path");
  this.directory = path.endsWith("/");
  int fromIndex = this.directory ? path.length() - 2 : path.length();
  this.name = path.substring(path.lastIndexOf("/", fromIndex) + 1);
  this.root = false;
  this.schema = schema;
  this.subEntries = createTreeMap();
  if (this.directory) {
    assertNull(schema, "schema");
  } else {
    assertNotNull(schema, "schema");
  }
}

代码示例来源:origin: webx/citrus

public Entry(String path, Schema schema) {
  this.path = assertNotNull(trimToNull(path), "path");
  this.directory = path.endsWith("/");
  int fromIndex = this.directory ? path.length() - 2 : path.length();
  this.name = path.substring(path.lastIndexOf("/", fromIndex) + 1);
  this.root = false;
  this.schema = schema;
  this.subEntries = createTreeMap();
  if (this.directory) {
    assertNull(schema, "schema");
  } else {
    assertNotNull(schema, "schema");
  }
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object, String message, Object... args) {
  return assertNull(object, null, message, args);
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

/** 确保对象为空,否则抛出<code>IllegalArgumentException</code>。 */
public static <T> T assertNull(T object) {
  return assertNull(object, null, null, (Object[]) null);
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

public void addSubElement(Element subElement) {
  assertNull(text, "text is not null");
  if (subElement != null) {
    subElements.add(subElement);
  }
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

private void setSource(AttachmentSource source) {
  assertNull(this.source, ILLEGAL_STATE, "Attachment source already set: %s", this.source);
  this.source = assertNotNull(source, "source");
}

相关文章