当前位置: 首页>>代码示例>>Java>>正文


Java StringUtil.nullIfEmpty方法代码示例

本文整理汇总了Java中jetbrains.buildServer.util.StringUtil.nullIfEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.nullIfEmpty方法的具体用法?Java StringUtil.nullIfEmpty怎么用?Java StringUtil.nullIfEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jetbrains.buildServer.util.StringUtil的用法示例。


在下文中一共展示了StringUtil.nullIfEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VmwareCloudImageDetails

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public VmwareCloudImageDetails(@NotNull final CloudImageParameters imageParameters){
  myCustomizationSpec = imageParameters.getParameter(VmwareConstants.CUSTOMIZATION_SPEC);
  myMaxInstances = StringUtil.parseInt(StringUtil.emptyIfNull(imageParameters.getParameter(VmwareConstants.MAX_INSTANCES)), 0);
  mySourceVmName = imageParameters.getParameter(VmwareConstants.SOURCE_VM_NAME);
  myFolderId = imageParameters.getParameter(VmwareConstants.FOLDER);
  myResourcePoolId = imageParameters.getParameter(VmwareConstants.RESOURCE_POOL);
  myCloneBehaviour = CloneBehaviour.valueOf(imageParameters.getParameter(VmwareConstants.BEHAVIOUR));
  mySnapshotName = StringUtil.emptyIfNull(imageParameters.getParameter(VmwareConstants.SNAPSHOT));
  myNickname = StringUtil.nullIfEmpty(imageParameters.getParameter(VmwareConstants.NICKNAME));
  myAgentPoolId = imageParameters.getAgentPoolId();
  if (myCloneBehaviour.isUseOriginal()){
    mySourceId = mySourceVmName;
  } else {
    mySourceId = myNickname == null ? mySourceVmName : myNickname;
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:17,代码来源:VmwareCloudImageDetails.java

示例2: uploadToBucket

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public void uploadToBucket(String bucketName, AmazonS3 s3Client, File file, String destinationDir, String cacheControlString) throws AmazonClientException {
    String key = StringUtil.nullIfEmpty(destinationDir) == null ? file.getName() : destinationDir + "/" + file.getName();

    PutObjectRequest request = new PutObjectRequest(
            bucketName, key, file);

    if (cacheControlString != null) {
        ObjectMetadata objectMetadata = new ObjectMetadata();
        objectMetadata.setCacheControl(cacheControlString);
        request.withMetadata(objectMetadata);
    }
    s3Client.putObject(request);
}
 
开发者ID:gonzadocarmo,项目名称:teamcity-s3-plugin,代码行数:14,代码来源:AWSS3UploadAdapter.java

示例3: createModel

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public @NotNull AgentRunnerBuildParametersModel createModel(@NotNull final Map<String, String> runnerParameters) {
    final String bucketName = StringUtils.trim(runnerParameters.get(PluginConstants.UI_PARAM_BUCKET_NAME));
    final String credentialsPublicKey = StringUtils.trim(runnerParameters.get(PluginConstants.UI_PARAM_CREDENTIALS_PUB_KEY));
    final String credentialsPrivateKey = StringUtils.trim(runnerParameters.get(PluginConstants.UI_PARAM_CREDENTIALS_PRIVATE_KEY));
    final String sourcePaths = runnerParameters.get(PluginConstants.UI_PARAM_CONTENT_PATHS);
    final boolean needToEmptyBucket = Boolean.valueOf(runnerParameters.get(PluginConstants.UI_PARAM_EMPTY_BUCKET));
    final String httpHeaderCacheControl = StringUtil.nullIfEmpty(StringUtils.trim(runnerParameters.get(PluginConstants.UI_PARAM_HTTP_HEADERS_CACHE_CONTROL)));
    final String httpProxy = StringUtils.trim(runnerParameters.get(PluginConstants.UI_PARAM_HTTP_PROXY));

    return new AgentRunnerBuildParametersModel(bucketName, credentialsPublicKey, credentialsPrivateKey, needToEmptyBucket, sourcePaths, httpHeaderCacheControl, httpProxy);
}
 
开发者ID:gonzadocarmo,项目名称:teamcity-s3-plugin,代码行数:12,代码来源:AWSS3BuildProcessAdapterHelper.java

示例4: getFilterFromRequest

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
protected Filter getFilterFromRequest(@NotNull final HttpServletRequest request) throws IncompleteFilterException {
	
	String id = StringUtil.nullIfEmpty(request.getParameter(DEBREPO_FILTER_ID));
	
	String regex = getParameterAsStringOrNull(request, DEBREPO_FILTER_REGEX, "The Regex field must not be empty");
	String dist = getParameterAsStringOrNull(request, DEBREPO_FILTER_DIST, "The dist field must not be empty");
	String component = getParameterAsStringOrNull(request, DEBREPO_FILTER_COMPONENT, "The component field must not be empty");
	
	if (id == null || "_new".equals(id) || "_copy".equals(id)){
		return new Filter(regex, dist, component);
	}

	return new Filter(id, regex, dist, component);
}
 
开发者ID:tcplugins,项目名称:tcDebRepository,代码行数:15,代码来源:ArtifactFilterAction.java

示例5: getParameterAsStringOrNull

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public String getParameterAsStringOrNull(HttpServletRequest request, String paramName, String errorMessage) throws IncompleteFilterException {
	String returnValue = StringUtil.nullIfEmpty(request.getParameter(paramName));
	if (returnValue == null || "".equals(returnValue.trim())) {
		throw new IncompleteFilterException(errorMessage);
	}
	return returnValue;
}
 
开发者ID:tcplugins,项目名称:tcDebRepository,代码行数:8,代码来源:ArtifactFilterAction.java


注:本文中的jetbrains.buildServer.util.StringUtil.nullIfEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。