Uploaded image for project: 'Solder'
  1. Solder
  2. SOLDER-14

Provide utility to check if Type is assignable to another Type

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Feature Request
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.0.Beta1
    • Future
    • Reflections
    • None
    • Medium

    Description

      Often times when writing an extension, you need to know if one Type is assignable from another Type. This is a more sophisticated version of Class#isAssignableFrom(Class) which takes into account paramaterized types.

      given
      parameterized type Bean<N extends Number>
      then
      type Bean<Number> is assignable from type Bean<Integer>

      One area where this is useful is when checking if a bean type is more specific than another bean type. It's not sufficient to assume the bean type is a simple class.

      Something similar to what is provided by: http://google-gson.googlecode.com/svn-history/r442/trunk/gson/src/main/java/com/google/gson/reflect/TypeToken.java

      Attachments

        Activity

          People

            dan.j.allen Dan Allen (Inactive)
            dan.j.allen Dan Allen (Inactive)
            Archiver:
            samahaja@redhat.com Sagar Mahajan

            Dates

              Created:
              Updated:
              Archived: