org.jboss.forge.furnace.util.Assert.notNull()方法的使用及代码示例

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

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

Assert.notNull介绍

[英]Assert that the given Object is not null; otherwise, throw an IllegalArgumentException with the given message.
[中]断言给定对象不是null;否则,使用给定消息抛出IllegalArgumentException。

代码示例

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

  1. protected AbstractAddonActionRequest(AddonInfo addonInfo, MutableAddonRepository addonRepository, Furnace furnace)
  2. {
  3. Assert.notNull(addonInfo, "AddonInfo must not be null.");
  4. Assert.notNull(furnace, "Addon Repository must not be null.");
  5. Assert.notNull(furnace, "Furnace must not be null.");
  6. this.addonInfo = addonInfo;
  7. this.furnace = furnace;
  8. this.repository = addonRepository;
  9. }

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

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

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

  1. public URLArchetypeCatalogFactory(String name, URL catalogURL, String defaultRepository)
  2. {
  3. super();
  4. Assert.notNull(name, "Name should not be null");
  5. Assert.notNull(catalogURL, "Catalog URL must be specified");
  6. this.name = name;
  7. this.catalogURL = catalogURL;
  8. this.defaultRepository = defaultRepository;
  9. }

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

  1. /**
  2. * Create an instance for the provided rule.
  3. */
  4. public RuleExecutionInformation(Rule rule)
  5. {
  6. Assert.notNull(rule, "Rule object must not be null");
  7. this.rule = rule;
  8. }

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

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

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

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

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

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

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

  1. public URLResourceImpl(ResourceFactory factory, URL resource)
  2. {
  3. super(factory, null);
  4. Assert.notNull(resource, "URL resource cannot be null");
  5. this.resource = resource;
  6. }

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

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

代码示例来源:origin: windup/windup

  1. /**
  2. * Create an instance for the provided rule.
  3. */
  4. public RuleExecutionInformation(Rule rule)
  5. {
  6. Assert.notNull(rule, "Rule object must not be null");
  7. this.rule = rule;
  8. }

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

  1. /**
  2. * Returns the {@link Addon} for which the given ClassLoader was produced.
  3. *
  4. * @param loader the {@link ClassLoader} this {@link Furnace} runtime can be found
  5. * @return the {@link Addon} for which the given ClassLoader represents
  6. */
  7. public static Addon getAddon(ClassLoader loader)
  8. {
  9. Assert.notNull(loader, "ClassLoader must not be null");
  10. ContainerEntry containerEntry = started.get(loader);
  11. return containerEntry != null ? containerEntry.addon : null;
  12. }

代码示例来源:origin: windup/windup

  1. @Override
  2. public FileMappingTo to(Class<? extends WindupVertexFrame> type)
  3. {
  4. Assert.notNull(type, "Model type must not be null.");
  5. this.types.add(type);
  6. return this;
  7. }

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

  1. /**
  2. * Returns if the version specified is a SNAPSHOT
  3. *
  4. * @param version cannot be null
  5. * @return true if the version is a SNAPSHOT, false otherwise
  6. */
  7. public static boolean isSnapshot(Version version)
  8. {
  9. Assert.notNull(version, "Version must not be null.");
  10. return version.toString().endsWith(SNAPSHOT_SUFFIX);
  11. }

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

  1. @Override
  2. public <FACETEDTYPE extends Faceted<?>, FACETTYPE extends Facet<FACETEDTYPE>> boolean install(FACETEDTYPE origin,
  3. FACETTYPE facet, Predicate<FACETTYPE> filter) throws IllegalArgumentException, IllegalStateException
  4. {
  5. Assert.notNull(origin, "Origin instance must not be null.");
  6. Assert.notNull(facet, "Facet instance must not be null.");
  7. Set<Class<FACETTYPE>> seen = new LinkedHashSet<>();
  8. return install(seen, origin, facet, filter);
  9. }

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

  1. /**
  2. * Create a new {@link UICommandMetadata} for the given {@link UICommand} type.
  3. */
  4. public static Metadata forCommand(Class<?> type)
  5. {
  6. Assert.notNull(type, "UICommand type must not be null.");
  7. return new Metadata(type);
  8. }

代码示例来源:origin: windup/windup

  1. /**
  2. * Optionally specify the variable name to use for the output of this condition
  3. */
  4. public ConditionBuilder as(String variable)
  5. {
  6. Assert.notNull(variable, "Variable name must not be null.");
  7. this.setOutputVariablesName(variable);
  8. return this;
  9. }

代码示例来源:origin: windup/windup

  1. /**
  2. * Output the results using the provided variable name.
  3. */
  4. public ConditionBuilder as(String variable)
  5. {
  6. Assert.notNull(variable, "Variable name must not be null.");
  7. this.setOutputVariablesName(variable);
  8. return this;
  9. }

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

  1. private <FACETEDTYPE extends Faceted<?>, FACETTYPE extends Facet<FACETEDTYPE>> Iterable<FACETTYPE> createFacets(
  2. Class<FACETTYPE> type)
  3. {
  4. Assert.notNull(type, "Facet type must not be null.");
  5. Imported<FACETTYPE> instances = getAddonRegistry().getServices(type);
  6. Set<FACETTYPE> facets = new HashSet<>();
  7. for (FACETTYPE instance : instances)
  8. {
  9. facets.add(instance);
  10. }
  11. return facets;
  12. }

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

  1. @Override
  2. public void store(Project project)
  3. {
  4. Assert.notNull(project, "Project should not be null");
  5. this.projects.put(project.getRoot().getFullyQualifiedName(), project);
  6. }

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

  1. @Override
  2. public boolean install()
  3. {
  4. Assert.notNull(frameworkVersion, "You should pick testing framework version before installing this facet");
  5. final DependencyFacet dependencyFacet = getDependencyFacet();
  6. getMatchingDependencies(dependencyFacet.getDependencies())
  7. .forEach(dependencyFacet::removeDependency);
  8. dependencyFacet.addDirectDependency(buildFrameworkDependency().setVersion(frameworkVersion));
  9. return true;
  10. }

相关文章