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


Java StringUtils.EMPTY属性代码示例

本文整理汇总了Java中org.apache.commons.lang.StringUtils.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.EMPTY属性的具体用法?Java StringUtils.EMPTY怎么用?Java StringUtils.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.lang.StringUtils的用法示例。


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

示例1: getResultString

/**
 * 取得结果字符串
 * 
 * @param result
 * @return
 */
protected String getResultString(Object result) {
    if (result == null) {
        return StringUtils.EMPTY;
    }

    if (result instanceof Map) { // 处理map
        return getMapResultString((Map) result);
    } else if (result instanceof List) {// 处理list
        return getListResultString((List) result);
    } else if (result.getClass().isArray()) {// 处理array
        return getArrayResultString((Object[]) result);
    } else {
        // 直接处理string
        return ObjectUtils.toString(result, StringUtils.EMPTY).toString();
        // return ToStringBuilder.reflectionToString(result, ToStringStyle.SIMPLE_STYLE);
    }
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:23,代码来源:LogInterceptor.java

示例2: setErrorResponse

/**
 * Sets response if an error occurs.
 *
 * @param request The request object.
 * @param response The response object.
 */
private void setErrorResponse(SugarRestRequest request, SugarRestResponse response) {
    ObjectMapper mapper = JsonObjectMapper.getMapper();
    String jsonRequest = StringUtils.EMPTY;
    String jsonResponse = StringUtils.EMPTY;

    try {
        jsonRequest = mapper.writeValueAsString(request);
        jsonResponse = mapper.writeValueAsString(response);
    } catch (JsonProcessingException exception) {
        ErrorResponse errorResponse = ErrorResponse.format(exception, exception.getMessage());
        errorResponse.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
        response.setError(errorResponse);
    }

    response.setData(null);
    response.setJData(StringUtils.EMPTY);
    response.setJsonRawRequest(jsonRequest);
    response.setJsonRawResponse(jsonResponse);
}
 
开发者ID:mattkol,项目名称:SugarOnRest,代码行数:25,代码来源:SugarRestClient.java

示例3: getEmail

public String getEmail(String dsSchemaName) {
    String email = StringUtils.EMPTY;

    HeartBeatVo hbConf = HeartBeatConfigContainer.getInstance().getHbConf();
    String adminUseEmail = hbConf.getAdminUseEmail();
    if (StringUtils.equals(adminUseEmail.toUpperCase(), "Y")) {
        email = hbConf.getAdminEmail();
    }

    if (StringUtils.isNotBlank(dsSchemaName)) {
        Map<String, Map<String, String>> additionalNotify = hbConf.getAdditionalNotify();
        Map<String, String> map = additionalNotify.get(dsSchemaName);
        if (map != null && StringUtils.equals(map.get("UseEmail").toUpperCase(), "Y")) {
            if (StringUtils.isNotBlank(email)) {
                email = StringUtils.join(new String[]{email, map.get("Email")}, ",");
            } else {
                email = map.get("Email");
            }
        }
    }

    return email;
}
 
开发者ID:BriData,项目名称:DBus,代码行数:23,代码来源:GlobalControlKafkaConsumerEvent.java

示例4: contents

/**
* 
* @Title: contents 
* @Description: get file contents
* @param @return
* @return String 
* @throws
 */
public static String contents(String filename)
{
    String content = StringUtils.EMPTY;
    try
    {
        InputStream is = FormatUtil.getInputStream(filename);
        content = IOUtils.toString(is, Charsets.UTF_8.getCname());
        FormatUtil.close(is);
    }
    catch(IOException e)
    {
        FormatView.getView().getStat().setText("Failed to read file: " + e.getMessage());
    }
    return content;
}
 
开发者ID:wisdomtool,项目名称:formatter,代码行数:23,代码来源:FormatUtil.java

示例5: init

private void init() {

		databaseClass = DEFAULT_DATABASE_CLASS;
		url = DETAULT_URL;
		driverClass = DEFAULT_H2_DRIVER;
		username = StringUtils.EMPTY;
		password = StringUtils.EMPTY;
		embeddedPort = DEFAULT_EMBEDDED_PORT;
		maxPool = DEFAULT_MAX_POOL;
		minPool = DEFAULT_MIN_POOL;
		initialPool = DEFAULT_INITIAL_POOL;
		maxIdleTime = DEFAULT_MAX_IDLE_TIME;
		maxStatementsPerConnection = DEFAULT_MAX_STATEMENTS_PER_CONNECTION;
		showCommands = false;
		testConnection = true;
	}
 
开发者ID:pflima92,项目名称:jspare-vertx-ms-blueprint,代码行数:16,代码来源:GatewayDatabaseOptions.java

示例6: explore

@Override
public void explore(List<AlarmRule> rules) {
    if (CollectionUtils.isEmpty(rules)) {
        return;
    }
    Long pipelineId = rules.get(0).getPipelineId();

    List<ProcessStat> processStats = processStatService.listRealtimeProcessStat(pipelineId);
    if (CollectionUtils.isEmpty(processStats)) {
        return;
    }

    long now = System.currentTimeMillis();
    Map<Long, Long> processTime = new HashMap<Long, Long>();
    for (ProcessStat processStat : processStats) {
        Long timeout = 0L;
        if (!CollectionUtils.isEmpty(processStat.getStageStats())) {
            timeout = now - processStat.getStageStats().get(0).getStartTime();
        }
        processTime.put(processStat.getProcessId(), timeout);
    }

    String message = StringUtils.EMPTY;
    for (AlarmRule rule : rules) {
        if (message.isEmpty()) {
            message = checkTimeout(rule, processTime);
        } else {
            checkTimeout(rule, processTime);
        }
    }

    if (!message.isEmpty()) {
        logRecordAlarm(pipelineId, MonitorName.PROCESSTIMEOUT, message);
    }

}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:36,代码来源:ProcessTimeoutRuleMonitor.java

示例7: getDebugFlag

protected String getDebugFlag(CmsWorkOrderSimpleBase ao) {
  String debugFlag = StringUtils.EMPTY;
  if (isDebugEnabled(ao)) {
    debugFlag = "-d";
  }
  return debugFlag;
}
 
开发者ID:oneops,项目名称:oneops,代码行数:7,代码来源:AbstractOrderExecutor.java

示例8: findFirst

public static String findFirst(String originalStr, String regex) {
    if (StringUtils.isBlank(originalStr) || StringUtils.isBlank(regex)) {
        return StringUtils.EMPTY;
    }

    PatternMatcher matcher = new Perl5Matcher();
    if (matcher.contains(originalStr, patterns.get(regex))) {
        return StringUtils.trimToEmpty(matcher.getMatch().group(0));
    }
    return StringUtils.EMPTY;
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:11,代码来源:RegexUtils.java

示例9: format

/**
* 
* @Title: format 
* @Description: Format text 
* @param @param txt
* @param @return 
* @return String
* @throws
 */
public static String format(String txt)
{
    if (StringUtils.isBlank(txt))
    {
        return StringUtils.EMPTY;
    }

    try
    {
        if (isJson(txt))
        {
            return prettyJson(txt);
        }

        if (isHtml(txt))
        {
            return prettyHtml(txt);
        }

        if (isXml(txt))
        {
            return prettyXml(txt);
        }
    }
    catch(Throwable e)
    {
        FormatView.getView().getStat().setText("Failed to format text: " + e.getMessage());
    }

    return txt;
}
 
开发者ID:wisdomtool,项目名称:formatter,代码行数:40,代码来源:FormatUtil.java

示例10: deleteGroupAccountTest

@Test
public void deleteGroupAccountTest() {

    SugarRestRequest request = new SugarRestRequest("Accounts", RequestType.BulkRead);
    request.setUrl(TestAccount.Url);
    request.setUsername(TestAccount.Username);
    request.setPassword(TestAccount.Password);

    List<QueryPredicate> queryPredicates = new ArrayList<QueryPredicate>();

    // Since query is set, the query predicates will be ignored.
    queryPredicates.add(new QueryPredicate("name", Contains, "SugarOnRest"));
    request.getOptions().setQueryPredicates(queryPredicates);

    SugarRestClient client = new SugarRestClient();
    SugarRestResponse response = client.execute(request);

    assertNotNull(response);
    assertEquals(response.getStatusCode(), HttpStatus.SC_OK);

    List<Accounts> accounts = (List<Accounts>)response.getData();
    if (accounts != null){
        for (Accounts account : accounts) {

            // -------------------Delete Account-------------------
            response = AccountsModule.deleteAccount(client, account.getId());

            assertNotNull(response);
            assertEquals(response.getStatusCode(), HttpStatus.SC_OK);

            String deleteId = (response.getData() == null) ? StringUtils.EMPTY : response.getData().toString();

            assertNotNull(deleteId);
            assertNotSame(deleteId, StringUtils.EMPTY );
            assertEquals(account.getId(), deleteId);

            // -------------------End Delete Account-------------------
        }
    }
}
 
开发者ID:mattkol,项目名称:SugarOnRest,代码行数:40,代码来源:AccountsModuleTests.java

示例11: SugarRestRequest

/**
 * Initializes a new instance of the SugarRestRequest class.
 *
 *  @param moduleType The SugarCRM module name.
 *  @param requestType The request type.
 */
public SugarRestRequest(Type moduleType, RequestType requestType) {
    this.setModuleType(moduleType);
    this.setRequestType(requestType);
    this.setOptions(new Options());
    this.validationMessage = StringUtils.EMPTY;
}
 
开发者ID:mattkol,项目名称:SugarOnRest,代码行数:12,代码来源:SugarRestRequest.java

示例12: bulkDeleteAccount

public static List<String> bulkDeleteAccount(SugarRestClient client, List<String> accountIds) {
    SugarRestRequest request = new SugarRestRequest("Accounts", RequestType.Delete);

    List<String> listId = new ArrayList<String>();
    for (String id : accountIds)
    {
        request.setParameter(id);
        SugarRestResponse response = client.execute(request);
        String identifier = (response.getData() == null) ? StringUtils.EMPTY : response.getData().toString();
        listId.add(identifier);
    }

    return listId;
}
 
开发者ID:mattkol,项目名称:SugarOnRest,代码行数:14,代码来源:AccountsModule.java

示例13: toAddressString

/**
 * InetSocketAddress转 host:port 字符串
 *
 * @param address InetSocketAddress转
 * @return host:port 字符串
 */
public static String toAddressString(InetSocketAddress address) {
    if (address == null) {
        return StringUtils.EMPTY;
    } else {
        return toIpString(address) + ":" + address.getPort();
    }
}
 
开发者ID:linkedkeeper,项目名称:tcp-gateway,代码行数:13,代码来源:NetUtils.java

示例14: getOrderType

/**
 * Returns the string constants for the order types
 *
 * @param type 0-TRANSFER, 1- PURCHASE, 2-SALES
 * @return try-TRANSFER, prc- PURCHASE,sle- SALES
 */
public static String getOrderType(Integer type) {
  if (type == 0) {
    return IOrder.TYPE_TRANSFER;
  } else if (type == 1) {
    return IOrder.TYPE_PURCHASE;
  } else if (type == 2) {
    return IOrder.TYPE_SALE;
  }
  return StringUtils.EMPTY;
}
 
开发者ID:logistimo,项目名称:logistimo-web-service,代码行数:16,代码来源:OrderUtils.java

示例15: columnDocumentation

/**
 * @see org.alfasoftware.morf.excel.AdditionalSchemaData#columnDocumentation(Table, java.lang.String)
 */
@Override
public String columnDocumentation(Table table, String columnName) {
  return StringUtils.EMPTY;
}
 
开发者ID:alfasoftware,项目名称:morf,代码行数:7,代码来源:DefaultAdditionalSchemaDataImpl.java


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