• 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: Educate me on generics please...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Educate me on generics please...


  • Subject: Re: Educate me on generics please...
  • From: Johann Werner <email@hidden>
  • Date: Wed, 6 Feb 2008 21:53:48 +0100


Am 06.02.2008 um 21:33 schrieb James Cicenia:

Well I have decided to to start going to 1.5 now.

this is something I do all the time:

NSMutableArray args2 = new NSMutableArray();
args2.addObject("portfolio");
args2.addObject(portfolio);
myQualifier2 = EOQualifier.qualifierWithQualifierFormat("%@ = %@", args2);

NSArray results = EOQualifier .filteredArrayWithQualifier(portfolioUserGroups(),myQualifier2);


How do I make that "generic Java 1.5" friendly?

a generic friendly version would be:

NSMutableArray<Object> args2 = new NSMutableArray<Object>();
args2.addObject("portfolio");
args2.addObject(portfolio);
EOQualifier myQualifier2 = EOQualifier.qualifierWithQualifierFormat("%@ = %@", args2);

NSArray<EOGenericRecord> results = (NSArray < EOGenericRecord > )EOQualifier .filteredArrayWithQualifier(portfolioUserGroups(),myQualifier2);



The mutable array uses Object as type so you can intermix diffent kinds of types as in your example. The results array will consist of one single type of entities so you should set it to whatever entity type you expect (I used EOGenericRecord as superclass as I don't know of what type the result should be). If you are using WO prior to 5.4 you have to typecast the return value of filteredArrayWithQualifier because genericised (?) functions appeared only in 5.4.


jw



Thanks, James Cicenia _______________________________________________ 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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: Educate me on generics please...
      • From: Mike Schrag <email@hidden>
    • Re: Educate me on generics please...
      • From: David den Boer <email@hidden>
References: 
 >Educate me on generics please... (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: Educate me on generics please...
  • Next by Date: Passing a value back to a subcomponent
  • Previous by thread: Re: Educate me on generics please...
  • Next by thread: Re: Educate me on generics please...
  • Index(es):
    • Date
    • Thread