本文整理了Java中org.dataconservancy.model.dcs.support.Assertion
类的一些代码示例,展示了Assertion
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assertion
类的具体详情如下:
包路径:org.dataconservancy.model.dcs.support.Assertion
类名称:Assertion
[英]Common assertions. IllegalArgumentExceptions are thrown if an assertion is violated.
[中]常见的断言。如果违反断言,将引发IllegalArgumentException。
代码示例来源:origin: org.dataconservancy.dcs/dcs-model-builder
/**
* Sets the error messages.
*
* @param errorMessages the error messages, must not be <code>null</code>
* @throws IllegalArgumentException if <code>errorMessages</code> are <code>null</code>
*/
public void setErrorMessages(List<String> errorMessages) {
Assertion.notNull(errorMessages);
this.errorMessages = errorMessages;
}
代码示例来源: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
/**
* The URI representing the relationship type.
*
* @param relUri the URI in string form
*/
public void setRelUri(String relUri) {
Assertion.notEmptyOrNull(relUri);
this.relUri = relUri;
}
代码示例来源:origin: org.dataconservancy.model/dcs-model
/**
* Set the identifier for the entity.
*
* @param id the identifier, must not be <code>null</code>
* @throws IllegalArgumentException if <code>id</code> is <code>null</code>
*/
public void setId(String id) {
Assertion.notEmptyOrNull(id);
this.id = id;
}
代码示例来源: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
/**
* Creates a DcsRelationship with a relationship type of <code>relUri</code> with <code>target</code>. See
* {@link DcsRelationship} for supported relationship types.
*
* @param relUri the relationship type, must not be empty or <code>null</code>
* @param target the target entity, must not be <code>null</code>
*/
public DcsRelation(String relUri, DcsEntityReference target) {
Assertion.notEmptyOrNull(relUri);
Assertion.notNull(target);
this.relUri = relUri;
this.ref = new DcsEntityReference(target);
}
代码示例来源:origin: org.dataconservancy.model/dcs-model
/**
* Convenience constructor, constructing a reference to <code>ref</code>
*
* @param ref the reference
*/
public DcsEntityReference(String ref) {
Assertion.notEmptyOrNull(ref);
this.ref = ref;
}
代码示例来源: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.model/dcs-model
/**
* Creates a DcsRelationship with a relationship type of <code>rel</code> with <code>target</code>. See
* {@link DcsRelationship} for supported relationship types.
*
* @param rel the relationship type, must not be <code>null</code>
* @param target the target entity, must not be empty or <code>null</code>
*/
public DcsRelation(DcsRelationship rel, String target) {
Assertion.notNull(rel);
Assertion.notEmptyOrNull(target);
this.relUri = rel.asString();
this.ref = new DcsEntityReference(target);
}
代码示例来源:origin: org.dataconservancy.model/dcs-model
/**
* Set the entity reference
*
* @param ref the entity reference, must not be empty or <code>null</code>
* @throws IllegalArgumentException if <code>ref</code> is empty or <code>null</code>
*/
public void setRef(String ref) {
Assertion.notEmptyOrNull(ref);
this.ref = ref;
}
代码示例来源: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.dcs/dcs-ui-model-builder-xstream
@Override
public void buildProject(Project project, OutputStream sink) {
Assertion.notNull(project);
Assertion.notNull(sink);
x.toXML(project, sink);
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream
@Override
public void buildDataFile(DataFile dataFile, OutputStream sink) {
Assertion.notNull(dataFile);
Assertion.notNull(sink);
x.toXML(dataFile, sink);
}
代码示例来源:origin: org.dataconservancy.model/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-ui-model-builder-xstream
@Override
public void buildMetadataFile(MetadataFile metadataFile, OutputStream sink) {
Assertion.notNull(metadataFile);
Assertion.notNull(sink);
x.toXML(metadataFile, sink);
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-gqm-builder-xstream
@Override
public void buildGeometry(Geometry geometry, OutputStream sink) {
Assertion.notNull(geometry);
Assertion.notNull(sink);
x.toXML(geometry, sink);
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-gqm-builder-xstream
@Override
public void buildDateTimeInterval(DateTimeInterval interval,
OutputStream sink) {
Assertion.notNull(interval);
Assertion.notNull(sink);
x.toXML(interval, sink);
}
代码示例来源:origin: org.dataconservancy.model/dcs-model-builder-xstream
@Override
public void buildEvent(DcsEvent event, OutputStream sink) {
Assertion.notNull(event);
Assertion.notNull(sink);
x.toXML(event, sink);
}
}
内容来源于网络,如有侵权,请联系作者删除!