MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / cname

Method cname

src/main/java/com/volmit/adapt/util/Form.java:946–962  ·  view source on GitHub ↗

Get a class name into a configuration/filename key For example, PhantomController.class is converted to phantom-controller @param clazz the class @return the string representation

(String clazz)

Source from the content-addressed store, hash-verified

944 * @return the string representation
945 */
946 public static String cname(String clazz) {
947 String codeName = "";
948
949 for (Character i : clazz.toCharArray()) {
950 if (Character.isUpperCase(i)) {
951 codeName = codeName + "-" + Character.toLowerCase(i);
952 } else {
953 codeName = codeName + i;
954 }
955 }
956
957 if (codeName.startsWith("-")) {
958 codeName = codeName.substring(1);
959 }
960
961 return codeName;
962 }
963
964 /**
965 * Get a formatted representation of the memory given in megabytes

Callers

nothing calls this directly

Calls 1

toCharArrayMethod · 0.80

Tested by

no test coverage detected