@Test public void testCompleteNormalisation() { assertThat(NameUtils.normaliseName(" hello world ")).isEqualTo("hello world"); }
public static String normaliseName(final String name) { if (Objects.isNull(name)) { return ""; } String value = name; if (StringUtils.nonEmpty(value)) { value = value.trim(); value = value.replaceAll(NORMALIZE_TO_SINGLE_WHITE_SPACE, WHITESPACE_STRING); } return value; }
NameUtils { public static String normaliseName(final String name) { if (Objects.isNull(name)) { return ""; } String value = name; if (StringUtils.nonEmpty(value)) { value = value.trim(); value = value.replaceAll(NORMALIZE_TO_SINGLE_WHITE_SPACE, WHITESPACE_STRING); } return value; } }
NameUtils { public static String normaliseName(final String name) { if (Objects.isNull(name)) { return ""; } String value = name; if (StringUtils.nonEmpty(value)) { value = value.trim(); value = value.replaceAll(NORMALIZE_TO_SINGLE_WHITE_SPACE, WHITESPACE_STRING); } return value; } private  NameUtils(); }
NameUtils { public static String normaliseName(final String name) { if (Objects.isNull(name)) { return ""; } String value = name; if (StringUtils.nonEmpty(value)) { value = value.trim(); value = value.replaceAll(NORMALIZE_TO_SINGLE_WHITE_SPACE, WHITESPACE_STRING); } return value; } private  NameUtils(); static String normaliseName(final String name); }
NameUtils { public static String normaliseName(final String name) { if (Objects.isNull(name)) { return ""; } String value = name; if (StringUtils.nonEmpty(value)) { value = value.trim(); value = value.replaceAll(NORMALIZE_TO_SINGLE_WHITE_SPACE, WHITESPACE_STRING); } return value; } private  NameUtils(); static String normaliseName(final String name);  }