Java Code Examples for org.apache.commons.lang3.ArrayUtils.toString()

The following are Jave code examples for showing how to use toString() of the org.apache.commons.lang3.ArrayUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: j1st-mqtt   File: MqttSubAckPayload.java   View Source Code Vote up 5 votes
@Override
public String toString() {
    return StringUtil.simpleClassName(this)
            + '['
            + "grantedQoSLevels=" + ArrayUtils.toString(grantedQoSLevels)
            + ']';
}
 
Example 2
Project: j1st-mqtt   File: MqttSubscribePayload.java   View Source Code Vote up 5 votes
@Override
public String toString() {
    return StringUtil.simpleClassName(this)
            + '['
            + "subscriptions=" + ArrayUtils.toString(subscriptions)
            + ']';
}
 
Example 3
Project: j1st-mqtt   File: MqttUnsubscribePayload.java   View Source Code Vote up 5 votes
@Override
public String toString() {
    return StringUtil.simpleClassName(this)
            + '['
            + "topics=" + ArrayUtils.toString(topics)
            + ']';
}
 
Example 4
Project: satisfy   File: SatisfyStepArgumentWriter.java   View Source Code Vote up 5 votes
public static String readableFormOf(Object arg) {
    if (arg == null) {
        return "<null>";
    } else if (arg.getClass().isArray()) {
        return ArrayUtils.toString(arg);
    } else if (arg instanceof ExamplesTable) {
        return "\n" + ((ExamplesTable) arg).asString();
    } else {
        return arg.toString();
    }
}
 
Example 5
Project: bootstrap   File: ValidationJsonException.java   View Source Code Vote up 5 votes
/**
 * Build a validation exception.
 * 
 * @param error
 *            the error code to throw.
 * @param fields
 *            Are the fields to report as error.When zero-size, {@value #DEFAULT_FIELD} field name is used.
 * @return a validation exception containing given errors.
 */
public static ValidationJsonException newValidationJsonException(final String error, final String... fields) {
	final ValidationJsonException exception = new ValidationJsonException(error + ":" + ArrayUtils.toString(fields));
	if (fields.length == 0) {
		exception.addError(DEFAULT_FIELD, error);
	} else {
		for (final String field : fields) {
			exception.addError(field, error);
		}
	}
	return exception;
}
 
Example 6
Project: jvm-sandbox   File: ModuleMgrModule.java   View Source Code Vote up 5 votes
@Http("/detail")
public void detail(final HttpServletRequest req,
                   final HttpServletResponse resp) throws ModuleException, IOException {
    final String uniqueId = req.getParameter("id");
    if (StringUtils.isBlank(uniqueId)) {
        // 如果参数不对,则认为找不到对应的沙箱模块,返回400
        resp.sendError(SC_BAD_REQUEST, "id parameter was required.");
        return;
    }

    final Module module = moduleManager.get(uniqueId);
    if (null == module) {
        resp.sendError(SC_BAD_REQUEST, String.format("module[id=%s] is not existed.", uniqueId));
        return;
    }

    final Information info = module.getClass().getAnnotation(Information.class);
    final boolean isActivated = moduleManager.isActivated(info.id());
    final int cCnt = moduleManager.cCnt(info.id());
    final int mCnt = moduleManager.mCnt(info.id());
    final File jarFile = moduleManager.getJarFile(info.id());
    String sb = "" +
            "      ID : " + info.id() + "\n" +
            " VERSION : " + info.version() + "\n" +
            "  AUTHOR : " + info.author() + "\n" +
            "JAR_FILE : " + jarFile.getPath() + "\n" +
            "   STATE : " + (isActivated ? "ACTIVE" : "FROZEN") + "\n" +
            "    MODE : " + ArrayUtils.toString(info.mode()) + "\n" +
            "   CLASS : " + module.getClass() + "\n" +
            "  LOADER : " + module.getClass().getClassLoader() + "\n" +
            "    cCnt : " + cCnt + "\n" +
            "    mCnt : " + mCnt;

    output(resp.getWriter(), sb);

}
 
Example 7
Project: bootstrap   File: ValidationJsonException.java   View Source Code Vote up 2 votes
/**
 * Constructor for a single error.
 * 
 * @param propertyName
 *            Name of the JSon property
 * @param errorText
 *            I18N key of the message.
 * @param parametersKeyValue
 *            Optional key and value pairs.
 */
public ValidationJsonException(final String propertyName, final Serializable errorText, final Serializable... parametersKeyValue) {
	this(propertyName + ":" + errorText + (parametersKeyValue.length > 0 ? ArrayUtils.toString(parametersKeyValue) : ""));
	addError(propertyName, errorText, parametersKeyValue);
}