public static Naming from(String template) {
    if (template.isEmpty() || template.equals(NAME_PLACEHOLDER)) {
      return IDENTITY_NAMING;
    }
    checkArgument(TEMPLATE_CHAR_MATCHER.matchesAllOf(template),
        "Naming template [%s] contains unsupported characters, only java identifier chars and '*' placeholder are allowed (ASCII only)",
        template);

    List<String> parts = TEMPLATE_SPLITTER.splitToList(template);
    checkArgument(parts.size() <= 2,
        "Naming template [%s] contains more than one '*' placeholder, which is unsupported",
        template);

    return parts.size() == 1
        ? new ConstantNaming(template)
        : new PrefixSuffixNaming(parts.get(0), parts.get(1));
  }
@param template template string
@return naming that could be applied or detected following template
generator/src/org/immutables/generator/Naming.java