org.jboss.forge.furnace.util.Assert类的使用及代码示例

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

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

Assert介绍

[英]Utility class for creating pre-condition assertions in method implementations.
[中]用于在方法实现中创建前置条件断言的实用程序类。

代码示例

代码示例来源:origin: org.jboss.forge.furnace/furnace-manager

protected AbstractAddonActionRequest(AddonInfo addonInfo, MutableAddonRepository addonRepository, Furnace furnace)
{
 Assert.notNull(addonInfo, "AddonInfo must not be null.");
 Assert.notNull(furnace, "Addon Repository must not be null.");
 Assert.notNull(furnace, "Furnace must not be null.");
 this.addonInfo = addonInfo;
 this.furnace = furnace;
 this.repository = addonRepository;
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-api

/**
* Calculate the intersection of one or more {@link VersionRange} instances, returning a single {@link VersionRange}
* as the result.
*/
public static VersionRange intersection(VersionRange... ranges)
{
 Assert.notNull(ranges, "Version ranges must not be null.");
 Assert.isTrue(ranges.length >= 1, "Version ranges must not be empty.");
 return intersection(Arrays.asList(ranges));
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-manager

private MutableAddonRepository assertMutableRepository(AddonRepository repository)
{
 Assert.isTrue(repository instanceof MutableAddonRepository, "Addon repository ["
      + repository.getRootDirectory().getAbsolutePath()
      + "] is not writable.");
 return (MutableAddonRepository) repository;
}

代码示例来源:origin: forge/core

public void addIrregular(String singular,
    String plural)
{
 Assert.isTrue(!Strings.isNullOrEmpty(singular), "singular rule");
 Assert.isTrue(!Strings.isNullOrEmpty(plural), "plural rule");
 String singularRemainder = singular.length() > 1 ? singular.substring(1) : "";
 String pluralRemainder = plural.length() > 1 ? plural.substring(1) : "";
 addPluralize("(" + singular.charAt(0) + ")" + singularRemainder + "$", "$1" + pluralRemainder);
 addSingularize("(" + plural.charAt(0) + ")" + pluralRemainder + "$", "$1" + singularRemainder);
}

代码示例来源:origin: org.jboss.forge.addon/maven-impl-projects

public FileResourceModelSource(FileResource<?> fileResource)
{
 Assert.notNull(fileResource, "POM Resource may not be null");
 this.fileResource = fileResource;
}

代码示例来源:origin: org.jboss.forge.addon/ui-api

/**
* @return the delegate bound to this decorator. Never a <code>null</code> reference.
* @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the
*            same reference as this decorator class
*/
protected final UIInput<VALUETYPE> getDelegate()
{
 if (delegate == null)
 {
   delegate = createDelegate();
   Assert.notNull(delegate, "Delegate cannot be null");
   Assert.isTrue(delegate != this, "Decorator cannot delegate to itself");
 }
 return delegate;
}

代码示例来源:origin: org.jboss.forge.addon/maven-impl

public URLArchetypeCatalogFactory(String name, URL catalogURL, String defaultRepository)
{
 super();
 Assert.notNull(name, "Name should not be null");
 Assert.notNull(catalogURL, "Catalog URL must be specified");
 this.name = name;
 this.catalogURL = catalogURL;
 this.defaultRepository = defaultRepository;
}

代码示例来源:origin: org.jboss.forge.addon/ui-api

/**
* @return the delegate bound to this decorator. Never a <code>null</code> reference.
* @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the
*            same reference as this decorator class
*/
protected final UISelectOne<VALUETYPE> getDelegate()
{
 if (delegate == null)
 {
   delegate = createDelegate();
   Assert.notNull(delegate, "Delegate cannot be null");
   Assert.isTrue(delegate != this, "Decorator cannot delegate to itself");
 }
 return delegate;
}

代码示例来源:origin: org.jboss.windup.reporting/windup-reporting-api

/**
 * Create an instance for the provided rule.
 */
public RuleExecutionInformation(Rule rule)
{
  Assert.notNull(rule, "Rule object must not be null");
  this.rule = rule;
}

代码示例来源:origin: org.jboss.forge.addon/ui-api

/**
* @return the delegate bound to this decorator. Never a <code>null</code> reference.
* @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the
*            same reference as this decorator class
*/
protected final UIInputMany<VALUETYPE> getDelegate()
{
 if (delegate == null)
 {
   delegate = createDelegate();
   Assert.notNull(delegate, "Delegate cannot be null");
   Assert.isTrue(delegate != this, "Decorator cannot delegate to itself");
 }
 return delegate;
}

代码示例来源:origin: org.jboss.windup.config/windup-config-api

/**
 * Construct a new {@link AbstractRulesetMetadata} instance using the given {@link String} ID.
 */
public AbstractRulesetMetadata(String id)
{
  Assert.notNull(id, "Ruleset ID must not be null.");
  this.id = id;
}

代码示例来源:origin: org.jboss.forge.addon/ui-api

/**
* @return the delegate bound to this decorator. Never a <code>null</code> reference.
* @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the
*            same reference as this decorator class
*/
protected final UISelectMany<VALUETYPE> getDelegate()
{
 if (delegate == null)
 {
   delegate = createDelegate();
   Assert.notNull(delegate, "Delegate cannot be null");
   Assert.isTrue(delegate != this, "Decorator cannot delegate to itself");
 }
 return delegate;
}

代码示例来源:origin: org.jboss.forge.addon/projects-api

private StackBuilder(String name)
{
 Assert.notNull(name, "Name cannot be null");
 this.name = name;
}

代码示例来源:origin: org.jboss.forge.addon/resources-impl

@Override
public ResourceMonitor monitor(Resource<?> resource, ResourceFilter resourceFilter)
{
 Assert.notNull(resource, "Resource cannot be null");
 Assert.isTrue(resource instanceof FileResource, "Resource must be a FileResource, was "
      + resource.getClass().getName());
 if (!resource.exists())
 {
   throw new IllegalStateException("Resource must exist to be monitored");
 }
 FileResource<?> fileResource = (FileResource<?>) resource;
 return getFileMonitor().registerMonitor(this, fileResource, resourceFilter);
}

代码示例来源:origin: org.jboss.forge.addon/javaee-api

public RestWebXmlConfigurationStrategy(String path)
{
 Assert.notNull(path, "Path cannot be null");
 this.path = path;
}

代码示例来源:origin: org.jboss.forge.addon/javaee-api

public RestApplicationClassConfigurationStrategy(JavaClassSource javaClass)
{
 Assert.notNull(javaClass, "JavaClass cannot be null");
 Assert.isTrue(javaClass.hasAnnotation(ApplicationPath.class),
      "@ApplicationPath should be present in the JavaClass");
 this.applicationClass = javaClass;
 this.path = javaClass.getAnnotation(ApplicationPath.class).getStringValue();
}

代码示例来源:origin: org.jboss.forge.addon/resources-impl

public URLResourceImpl(ResourceFactory factory, URL resource)
{
 super(factory, null);
 Assert.notNull(resource, "URL resource cannot be null");
 this.resource = resource;
}

代码示例来源:origin: org.jboss.forge.addon/projects-impl

@Override
public boolean containsProject(Resource<?> bound, Resource<?> target, ProjectProvider buildSystem)
{
 Assert.notNull(bound, "Boundary should not be null");
 Assert.isTrue(bound.equals(target) || isParent(bound, target), "Target should be a child of bound");
 boolean found = false;
 Resource<?> r = bound;
 while (r != null && !found)
 {
   found = buildSystem.containsProject(r);
   if (target.equals(r))
   {
    break;
   }
   r = r.getParent();
 }
 return found;
}

代码示例来源:origin: org.jboss.forge.addon/facets-impl

protected AbstractFacetEvent(Facet<?> facet)
{
 Assert.notNull(facet, "Facet should not be null");
 this.facet = facet;
}

代码示例来源:origin: org.jboss.forge.addon/templates-impl

@Override
public Template create(Resource<?> template, Class<? extends Template> type)
{
 Assert.notNull(template, "Template resource cannot be null");
 Assert.isTrue(template.exists(), "Template does not exist: " + template);
 for (TemplateGenerator generator : getTemplateGenerators())
 {
   if (generator.handles(type))
   {
    return generator.create(template, type);
   }
 }
 return null;
}

相关文章