• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Parameterized NSArray in 5.3.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parameterized NSArray in 5.3.3


  • Subject: Re: Parameterized NSArray in 5.3.3
  • From: Florijan Stamenkovic <email@hidden>
  • Date: Wed, 23 Jul 2008 21:39:10 -0400


On Jul 23, 2008, at 17:14, Mike Schrag wrote:

Nope. String is final. <Object> means, well, any Object. Wildcards are useless in this scenario.

F

try this:

http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf

It's a bit dry but explains the whys and hows of generics and wildcards.
Actually it should be NSDictionary<String, ? extends Object> or rather just NSDictionary<String, ?> probably in that case... Otherwise you can ONLY pass in literally an NSDictionary<String, Object> and not any subclasses of the values. In Wonder, you'll see our variants of these methods are:

public static String directActionUrl(WOContext context, String directActionName, NSDictionary<String, ? extends Object> queryParameters, Boolean secure, boolean includeSessionID)

I suppose you could argue that you should be instantiating an NSDictionary<String, Object> instead of a <String, String> but the method technically takes a map from String to any object type, so I think the ? better expresses the intent.

Yeah, I see this point, didn't think of it.

Sorry for misinformation.

F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Parameterized NSArray in 5.3.3 (From: Rams <email@hidden>)
 >Re: Parameterized NSArray in 5.3.3 (From: Guido Neitzer <email@hidden>)
 >Re: Parameterized NSArray in 5.3.3 (From: Rams <email@hidden>)
 >Re: Parameterized NSArray in 5.3.3 (From: Guido Neitzer <email@hidden>)
 >Re: Parameterized NSArray in 5.3.3 (From: Rams <email@hidden>)
 >Re: Parameterized NSArray in 5.3.3 (From: Florijan Stamenkovic <email@hidden>)
 >Re: Parameterized NSArray in 5.3.3 (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Parameterized NSArray in 5.3.3
  • Next by Date: Re: Parameterized NSArray in 5.3.3
  • Previous by thread: Re: Parameterized NSArray in 5.3.3
  • Next by thread: Re: Parameterized NSArray in 5.3.3
  • Index(es):
    • Date
    • Thread