[Lift] Re: optional validation

2009-04-23 Thread David Pollak
On Thu, Apr 23, 2009 at 12:01 PM, g-man wrote: > > Nice -- I'm getting the spirit of Lift now; it's kind of a way of > saying 'NULL or Validate', right? > Yes. > > > On Apr 23, 10:39 am, David Pollak > wrote: > > How about: > > > > class MappedBlankableEmail[T<:Mapper[T]](owner: T, maxLen: In

[Lift] Re: optional validation

2009-04-23 Thread g-man
Nice -- I'm getting the spirit of Lift now; it's kind of a way of saying 'NULL or Validate', right? On Apr 23, 10:39 am, David Pollak wrote: > How about: > > class MappedBlankableEmail[T<:Mapper[T]](owner: T, maxLen: Int) extends > MappedString[T](owner, maxLen) { > >   override def setFilter =

[Lift] Re: optional validation

2009-04-23 Thread David Pollak
How about: class MappedBlankableEmail[T<:Mapper[T]](owner: T, maxLen: Int) extends MappedString[T](owner, maxLen) { override def setFilter = notNull _ :: toLower _ :: trim _ :: super.setFilter override def validate = (if (*i_is_!.length == 0 || *MappedEmail.emailPattern.matcher(i_is_!).m