org.gradle.api.provider.Provider.isPresent()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(163)

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

Provider.isPresent介绍

暂无

代码示例

代码示例来源:origin: org.gradle/gradle-core

@Override
public boolean isPresent() {
  return provider.isPresent();
}

代码示例来源:origin: org.gradle/gradle-core

@Override
public boolean isPresent() {
  return provider.isPresent();
}

代码示例来源:origin: org.gradle/gradle-core

@Override
public boolean isPresent() {
  return valueProvider == null || valueProvider.isPresent();
}

代码示例来源:origin: org.gradle/gradle-core

@Override
public boolean isPresent() {
  return base.isPresent() && provider.isPresent();
}

代码示例来源:origin: org.gradle/gradle-core

@Override
public OUT getOrNull() {
  if (base.isPresent() && provider.isPresent()) {
    return map(base.get(), provider.get());
  }
  return null;
}

代码示例来源:origin: org.gradle/gradle-core

@Override
public OUT getOrNull() {
  if (provider.isPresent()) {
    return map(provider.get());
  }
  return null;
}

代码示例来源:origin: Devskiller/jpa2ddl

private void fillDefaults(Project project, GeneratePluginExtension generatePluginExtension) {
    if (!generatePluginExtension.getPackagesProvider().isPresent()) {
      throw new IllegalArgumentException("JPA2DDL: No packages property found - it must point to model packages");
    }
    if (!generatePluginExtension.getActionProvider().isPresent()) {
      generatePluginExtension.setAction(Action.CREATE);
    }
    if (!generatePluginExtension.getGenerationModeProvider().isPresent()) {
      generatePluginExtension.setGenerationMode(GenerationMode.DATABASE);
    }
    if (!generatePluginExtension.getDelimiterProvider().isPresent()) {
      generatePluginExtension.setDelimiter(";");
    }
    if (!generatePluginExtension.getFormatOutputProvider().isPresent()) {
      generatePluginExtension.setFormatOutput(true);
    }
    if (!generatePluginExtension.getSkipSequencesProvider().isPresent()) {
      generatePluginExtension.setSkipSequences(false);
    }
    if (!generatePluginExtension.getJpaPropertiesProvider().isPresent()) {
      generatePluginExtension.setJpaProperties(new Properties());
    }
    if (!generatePluginExtension.getOutputPathProvider().isPresent()) {
      String filePath = generatePluginExtension.getAction() == Action.UPDATE ? "scripts/" : "scripts/database.sql";
      generatePluginExtension.setOutputPath(project.getBuildDir().toPath().resolve("generated-resources/main/" + filePath).toFile());
    }
  }
}

相关文章