• 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 question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generics question


  • Subject: Generics question
  • From: "Ricardo J. Parada" <email@hidden>
  • Date: Thu, 28 May 2009 19:00:06 -0400



I'm changing my code to use pageWithName(Foo.class) instead of pageWithName("Foo") through out the code.

Then I used to have a method that return the name of the login page which I changed to return the class of the login page.  But then if an application wants to override that I end up with stuff like this:

    public Class<MPVLoginPage> loginPageClass() {
        return PPPLoginPage.class;
    }

Here PPPLoginPage is a subclass of MPVLoginPage and I thought this would be allowed by java but I'm getting an error and I have not mastered generics that well yet.  ;-)

Is there a better way to do this?

:-)

 _______________________________________________
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 question
      • From: Phillip Hutchings <email@hidden>
  • Prev by Date: getResource and friends
  • Next by Date: Re: Generics question
  • Previous by thread: Re: getResource and friends
  • Next by thread: Re: Generics question
  • Index(es):
    • Date
    • Thread