Java Code Examples for org.springframework.util.StringUtils.arrayToDelimitedString()

The following are Jave code examples for showing how to use arrayToDelimitedString() of the org.springframework.util.StringUtils 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: spring-domain-events   File: PublicationTargetIdentifier.java   View Source Code Vote up 7 votes
/**
 * Creates a {@link PublicationTargetIdentifier} for the given {@link Method}.
 * 
 * @param method must not be {@literal null}.
 * @return
 */
public static PublicationTargetIdentifier forMethod(Method method) {

	String typeName = ClassUtils.getUserClass(method.getDeclaringClass()).getName();
	String methodName = method.getName();
	String parameterTypes = StringUtils.arrayToDelimitedString(method.getParameterTypes(), ", ");

	return PublicationTargetIdentifier.of(String.format("%s.%s(%s)", typeName, methodName, parameterTypes));
}
 
Example 2
Project: spring-hateoas-examples   File: Employee.java   View Source Code Vote up 5 votes
/**
 * Split things up, and assign the first token to {@literal firstName} with everything else to {@literal lastName}.
 *
 * @param wholeName
 */
public void setName(String wholeName) {

	String[] parts = wholeName.split(" ");
	this.firstName = parts[0];
	if (parts.length > 1) {
		this.lastName = StringUtils.arrayToDelimitedString(Arrays.copyOfRange(parts, 1, parts.length), " ");
	} else {
		this.lastName = "";
	}
}
 
Example 3
Project: spring-credhub   File: CredentialName.java   View Source Code Vote up 5 votes
/**
 * Builds a name from the provided segments.
 *
 * @return the credential name
 */
@JsonInclude
public String getName() {
	if (segments.length == 1) {
		return segments[0];
	} else {
		return "/" + StringUtils.arrayToDelimitedString(segments, "/");
	}
}
 
Example 4
Project: lams   File: UnsatisfiedServletRequestParameterException.java   View Source Code Vote up 4 votes
@Override
public String getMessage() {
	return "Parameter conditions \"" + StringUtils.arrayToDelimitedString(this.paramConditions, ", ") +
			"\" not met for actual request parameters: " + requestParameterMapToString(this.actualParams);
}
 
Example 5
Project: lams   File: StringArrayPropertyEditor.java   View Source Code Vote up 4 votes
@Override
public String getAsText() {
	return StringUtils.arrayToDelimitedString(ObjectUtils.toObjectArray(getValue()), this.separator);
}
 
Example 6
Project: shoucang   File: StringUtil.java   View Source Code Vote up 4 votes
public static String toMachineString(String str) {
    String token = str.toLowerCase().replace("\n", " ").replaceAll("[\\s]", " ").replaceAll("/", " ");
    return StringUtils.arrayToDelimitedString(StringUtils.tokenizeToStringArray(token, " "), "-");
}