• 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
Generics in WO - Writing accessors for to-many relationship?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generics in WO - Writing accessors for to-many relationship?


  • Subject: Generics in WO - Writing accessors for to-many relationship?
  • From: Ricardo Parada <email@hidden>
  • Date: Thu, 1 Nov 2007 12:55:19 -0500

Hi All,

Just wondering how people are writing their accessor methods inside their EOs now that NSArray and NSMutableArray have been parameterized (did I say that right? :-) ).  For example consider the following accessors for a to-many relationship called "records".  Is this the right way to do it because line #7 is still generating a warning in eclipse.  And what is the correct type for the setRecords() method?  Should it take an NSMutableArray<Record> or an NSArray<Record> argument?


 1:    public void setRecords(NSMutableArray<Record> value) {
 2:       takeStoredValueForKey(value, "records");
 3:    }
 4:
 5:
 6:    public NSArray<Record> records() {
 7:        return ((NSArray<Record>)storedValueForKey("records"));
 8:    }
 9:
10:
11:    public void addToRecords(Record value) {
12:        includeObjectIntoPropertyWithKey(value, "records");
13:    }
14:
15:
16:    public void removeFromRecords(Record value) {
17:        excludeObjectFromPropertyWithKey(value, "records");
18:    }

 _______________________________________________
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: Generics in WO - Writing accessors for to-many relationship?
      • From: "John Huss" <email@hidden>
  • Prev by Date: Re: WO5.4 UTF-8 code
  • Next by Date: Re: Generics in WO - Writing accessors for to-many relationship?
  • Previous by thread: Re: WO5.4 and Java Client
  • Next by thread: Re: Generics in WO - Writing accessors for to-many relationship?
  • Index(es):
    • Date
    • Thread