/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * Concatenate strings with a separator * * @param stringList * @param defaultEmptyValue * @return */ protected String getListWithSeparator(List<String> stringList, String defaultEmptyValue) { final String SEPARATOR = " "; StrBuilder builder = new StrBuilder(); builder = builder.appendWithSeparators(stringList, SEPARATOR); return builder.isEmpty() ? defaultEmptyValue : builder.toString(); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * Checks if the specified variable is already in the stack (list) of variables. * * @param varName the variable name to check * @param priorVariables the list of prior variables */ private void checkCyclicSubstitution(String varName, List priorVariables) { if (priorVariables.contains(varName) == false) { return; } StrBuilder buf = new StrBuilder(256); buf.append("Infinite loop in property interpolation of "); buf.append(priorVariables.remove(0)); buf.append(": "); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); }
/** * Retrieve textual representation of exception data:<br> * <ol> * <li> Error code returned by server<br> * <li> Error message<br> * <li> Error list * </ol> * @return textual representation of Exception data */ public String getTextRepresentation() { StrBuilder sb = new StrBuilder(); sb.append("RestException[\n\t"); sb.append(message).append("\n\t"); for(Entry<String, List<String>> msgs : errors.entrySet()) { sb.append(msgs.getKey()).append(" => ["); sb.appendWithSeparators(msgs.getValue(), "\n\t\t"); sb.append("]\n\t"); } sb.setLength(sb.length() - 1); return sb.append("]").toString(); } }
private String createSummaryString(int truncateLength) { StrBuilder httpString = new StrBuilder(); httpString.append(protocolVersion).append(" ").append(statusCode).append(" ").append(statusMessage); httpString.appendNewLine(); httpString.appendWithSeparators(headers, SystemUtils.LINE_SEPARATOR); if (StringUtils.isNotEmpty(content)) { httpString.appendNewLine(); httpString.appendNewLine(); httpString.append(StringUtils.abbreviate(content, truncateLength)); } return httpString.toString(); }
private String createSummaryString(int truncateLength) { StrBuilder httpString = new StrBuilder(); httpString.append(protocolVersion).append(" ").append(statusCode).append(" ").append(statusMessage); httpString.appendNewLine(); httpString.appendWithSeparators(headers, SystemUtils.LINE_SEPARATOR); if (StringUtils.isNotEmpty(content)) { httpString.appendNewLine(); httpString.appendNewLine(); httpString.append(StringUtils.abbreviate(content, truncateLength)); } return httpString.toString(); }