class 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();

}