Add validateWithString class method