jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <aphill...@qrmedia.com>
Subject Re: Historical context of *Options.NONE?
Date Wed, 21 May 2014 19:25:39 GMT
> Many of the option classes in jclouds have a "NONE” field that   
> cleverly creates a default instance of the class containing no   
> options. Can anyone enlighten me on the history of this pattern and   
> why this is necessary?

My best guess is that this may have been an instance of the Null  
Object pattern, so that you can do things like:

public X list() {
   return list(Options.NONE);

and can then implement the version *with* options without having to  
check for null options etc.


View raw message