commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ludwig Magnusson" <lud...@itcatapult.com>
Subject RE: [Lang] Null safe date comparisson
Date Thu, 06 Jan 2011 17:34:32 GMT
By appropriate I mean that I don't really have a specification for the
behavior. All I need is a method that can handle null without throwing an
exception. If such methods were to exist, the creators would surely have
thought of different ways to solve null arguments and they would probably
have solved it in some way if the code standard was good (and apaches
usually is).

 

My question was. Does such a method/library exist to anyone's knowledge?

If not, perhaps we could build one if people are interested and then we
could discuss what behavior is "appropriate".

 

/Ludwig

 

From: sebb [mailto:sebbaz@gmail.com] 
Sent: den 6 januari 2011 17:39
To: Commons Users List
Subject: Re: [Lang] Null safe date comparisson

 

On 6 January 2011 16:31, Ludwig Magnusson <ludwig@itcatapult.com> wrote:
> Hi!
>
> I'm looking for a way to do null safe date comparison. Something like:
>
>
>
> public static boolean isBefore(Date first, Date second);
>
>
>
> The method would handle null in an appropriate way.

What do you mean by appropriate?

Does null mean beginning of time, or end of time, or now, or Y2K or
something else?

How does one choose the default?

> I haven't found any method like that in DateUtils.
>
> Is there one somewhere?
>
> /Ludwig
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org

  _____  

No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1191 / Virus Database: 1435/3362 - Release Date: 01/05/11


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message