org.dataconservancy.model.dcs.support.Assertion.notNull()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(129)

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

Assertion.notNull介绍

[英]Throws IllegalArgumentException if o is null.
[中]如果onull,则引发IllegalArgumentException。

代码示例

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void addFile(DcsFile... file) {
  Assertion.notNull(file);
  for (DcsFile f : file) {
    Assertion.notNull(f);
    this.files.add(f);
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model-builder-xstream

@Override
public void buildFile(DcsFile file, OutputStream sink) {
  Assertion.notNull(file);
  Assertion.notNull(sink);
  x.toXML(file, sink);
}

代码示例来源:origin: org.dataconservancy.dcs/dcs-model-builder-xstream

@Override
public void buildFile(DcsFile file, OutputStream sink) {
  Assertion.notNull(file);
  Assertion.notNull(sink);
  x.toXML(file, sink);
}

代码示例来源:origin: org.dataconservancy.dcs/dcs-model-builder-xstream

@Override
public void buildCollection(DcsCollection collection, OutputStream sink) {
  Assertion.notNull(collection);
  Assertion.notNull(sink);
  x.toXML(collection, sink);
}

代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream

@Override
public void buildBusinessObjectPackage(Bop bop, OutputStream sink) {
  Assertion.notNull(bop);
  Assertion.notNull(sink);
  x.toXML(bop, sink);
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void setDeliverableUnits(Set<DcsDeliverableUnit> deliverableUnits) {
  Assertion.notNull(deliverableUnits);
  this.deliverableUnits = new HashSet<DcsDeliverableUnit>(deliverableUnits.size());
  for ( DcsDeliverableUnit d : deliverableUnits ) {
    Assertion.notNull(d);
    this.deliverableUnits.add(d);
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void setCollections(Set<DcsCollection> collections) {
  Assertion.notNull(collections);
  this.collections = new HashSet<DcsCollection>(collections.size());
  for (DcsCollection c : collections) {
    Assertion.notNull(c);
    this.collections.add(c);
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-ui-model

public void setDataItems(Set<DataItem> dataItems) {
  Assertion.notNull(dataItems);
  this.dataItems = new HashSet<DataItem>(dataItems.size());
  for (DataItem du : dataItems) {
    Assertion.notNull(du);
    this.dataItems.add(du);
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void addDeliverableUnit(DcsDeliverableUnit... deliverableUnit) {
  Assertion.notNull(deliverableUnit);
  for (DcsDeliverableUnit du : deliverableUnit) {
    Assertion.notNull(du);
    this.deliverableUnits.add(new DcsDeliverableUnit(du));
  }
}

代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model

public void addPerson(Person... person) {
  Assertion.notNull(person);
  for (Person du : person) {
    Assertion.notNull(du);
    this.persons.add(new Person(du));
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-ui-model

public void addProject(Project... project) {
  Assertion.notNull(project);
  for (Project du : project) {
    Assertion.notNull(du);
    this.projects.add(new Project(du));
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void setMetadata(Set<DcsMetadata> metadata) {
  Assertion.notNull(metadata);
  this.metadata = new HashSet<DcsMetadata>(metadata.size());        
  for (DcsMetadata m : metadata) {
    Assertion.notNull(m);
    this.metadata.add(new DcsMetadata(m));
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void setMetadata(Set<DcsMetadata> metadata) {
  Assertion.notNull(metadata);
  this.metadata = new HashSet<DcsMetadata>(metadata.size());
  for (DcsMetadata m : metadata) {
    Assertion.notNull(m);
    this.metadata.add(new DcsMetadata(m));
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void setManifestationFiles(Set<DcsManifestationFile> manifestationFiles) {
  Assertion.notNull(manifestationFiles);
  this.manifestationFiles = new HashSet<DcsManifestationFile>(manifestationFiles.size());
  for (DcsManifestationFile mf : manifestationFiles) {
    Assertion.notNull(mf);
    this.manifestationFiles.add(new DcsManifestationFile(mf));
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

/**
 * Add a relationship to this manifestation file.
 *
 * @param rel the relationship, must not be <code>null</code>.
 */
public void addRel(DcsRelation rel) {
  Assertion.notNull(rel);
  this.relSet.add(new DcsRelation(rel));
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

public void addTechnicalEnvironment(String... technicalEnvironment) {
  Assertion.notNull(technicalEnvironment);
  for (String s : technicalEnvironment) {
    Assertion.notEmptyOrNull(s);
    this.technicalEnvironment.add(s);
  }
}

代码示例来源:origin: org.dataconservancy.model/dcs-model

/**
 * Copy constructor for a DcsEntity.  The state of <code>toCopy</code> is copied
 * to this.
 *
 * @param toCopy the dcs entity to copy, must not be <code>null</code>
 * @throws IllegalArgumentException if <code>toCopy</code> is <code>null</code>
 */
public DcsEntity(DcsEntity toCopy) {
  Assertion.notNull(toCopy);
  this.id = toCopy.getId();
}

代码示例来源:origin: org.dataconservancy.model/dcs-model-builder-xstream

/**
 * Copies the current node and its children to the <code>writer</code>.
 *
 * @param in
 * @param writer the writer to write to
 * @throws javax.xml.stream.XMLStreamException
 */
public void copyNode(XMLStreamReader in, DcsStaxWriter writer) throws XMLStreamException {
  Assertion.notNull(in);
  Assertion.notNull(writer);
  copyNode(in, writer.getXMLStreamWriter());
}

代码示例来源:origin: org.dataconservancy.model/dcs-model-builder-xstream

@Override
public DcsManifestation buildManifestation(InputStream in) throws InvalidXmlException {
  Assertion.notNull(in);
  final DcsManifestation man;
  try {
    man = (DcsManifestation) x.fromXML(in);
  } catch (StreamException e) {
    log.debug(String.format(DESER_ERR, e.getMessage()), e);
    throw new InvalidXmlException(e);
  }
  return man;
}

代码示例来源:origin: org.dataconservancy.dcs/dcs-model-builder-xstream

@Override
public DcsFile buildFile(InputStream in) throws InvalidXmlException {
  Assertion.notNull(in);
  final DcsFile file;
  try {
    file = (DcsFile) x.fromXML(in);
  } catch (StreamException e) {
    log.debug(String.format(DESER_ERR, e.getMessage()), e);
    throw new InvalidXmlException(e);
  }
  return file;
}

相关文章

Assertion类方法