Search Results

Search found 2 results on 1 pages for 'droo'.

Page 1/1 | 1 

  • Type-safe, generic, empty Collections with static generics

    - by Droo
    I return empty collections vs. null whenever possible. I switch between two methods for doing so using java.util.Collections: return Collections.EMPTY_LIST; return Collections.emptyList(); where emptyList() is supposed to be type-safe. But I recently discovered: return Collections.<ComplexObject> emptyList(); return Collections.<ComplexObject> singletonList(new ComplexObject()); etc. I see this method in Eclipse Package Explorer: <clinit> () : void but I don't see how this is done in the source code (1.5). How is this magic tomfoolerie happening!!

    Read the article

  • What to use for space in REST URI?

    - by Droo
    What should I use: /findby/name/{first}_{last} /findby/name/{first}-{last} /findby/name/{first};{last} /findby/name/first/{first}/last/{last} etc. The URI represents a Person resource with 1 name, but I need to logically separate the first from the last to identify each. I kind of like the last example because I can do: /findby/name/first/{first} /findby/name/last/{last} /findby/name/first/{first}/last/{last}

    Read the article

1