@Test public void testValidNames() { TypeNameValidator.validate(TypeName.of("Camel", PACKAGE)); TypeNameValidator.validate(TypeName.of("CamelCase", PACKAGE)); TypeNameValidator.validate(TypeName.of("CamelCase1", PACKAGE)); TypeNameValidator.validate(TypeName.of("Camel1Case2", PACKAGE)); }
public static void validate(TypeName typeName) { Preconditions.checkArgument( CUSTOM_TYPE_PATTERN.matcher(typeName.getName()).matches() || PRIMITIVE_TYPES.contains(typeName.getName()), "TypeNames must be a primitive type %s or match pattern %s: %s", PRIMITIVE_TYPES, CUSTOM_TYPE_PATTERN, typeName.getName()); }
TypeNameValidator { public static void validate(TypeName typeName) { Preconditions.checkArgument( CUSTOM_TYPE_PATTERN.matcher(typeName.getName()).matches() || PRIMITIVE_TYPES.contains(typeName.getName()), "TypeNames must be a primitive type %s or match pattern %s: %s", PRIMITIVE_TYPES, CUSTOM_TYPE_PATTERN, typeName.getName()); } }
TypeNameValidator { public static void validate(TypeName typeName) { Preconditions.checkArgument( CUSTOM_TYPE_PATTERN.matcher(typeName.getName()).matches() || PRIMITIVE_TYPES.contains(typeName.getName()), "TypeNames must be a primitive type %s or match pattern %s: %s", PRIMITIVE_TYPES, CUSTOM_TYPE_PATTERN, typeName.getName()); } private  TypeNameValidator(); }
TypeNameValidator { public static void validate(TypeName typeName) { Preconditions.checkArgument( CUSTOM_TYPE_PATTERN.matcher(typeName.getName()).matches() || PRIMITIVE_TYPES.contains(typeName.getName()), "TypeNames must be a primitive type %s or match pattern %s: %s", PRIMITIVE_TYPES, CUSTOM_TYPE_PATTERN, typeName.getName()); } private  TypeNameValidator(); static void validate(TypeName typeName); }
TypeNameValidator { public static void validate(TypeName typeName) { Preconditions.checkArgument( CUSTOM_TYPE_PATTERN.matcher(typeName.getName()).matches() || PRIMITIVE_TYPES.contains(typeName.getName()), "TypeNames must be a primitive type %s or match pattern %s: %s", PRIMITIVE_TYPES, CUSTOM_TYPE_PATTERN, typeName.getName()); } private  TypeNameValidator(); static void validate(TypeName typeName);  }