blob: 57f4187429225699baea99fdec1ece4c9d0ea4b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package org.onap.sdc.tosca.parser.utils;
import java.util.regex.Pattern;
public class SdcToscaUtility {
public final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
public static String normaliseComponentInstanceName(String name) {
String normalizedName = name.toLowerCase();
normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
String[] split = normalizedName.split(" ");
StringBuffer sb = new StringBuffer();
for (String splitElement : split) {
sb.append(splitElement);
}
return sb.toString();
}
}
|