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

Provide a utility to transparently wrap primitive types

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0.Beta1
    • Component/s: Reflections
    • Labels:
      None
    • Estimated Difficulty:
      Low

      Description

      When dealing at the level of a Type, it would be helpful to have a method that would automatically convert the Type to a primitive wrapper if the original Type represents a primitive. This functionality is provided by the Primitives class in Guava.

      Type type = Primitives.wrap(ip.getType());

      At this point, we know that "type" does not represent a primitive.

      http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/primitives/Primitives.html

        Gliffy Diagrams

          Activity

          Hide
          pmuir Pete Muir added a comment -

          We can port this from Weld easily enough.

          I would call it Types.box() though.

          Show
          pmuir Pete Muir added a comment - We can port this from Weld easily enough. I would call it Types.box() though.
          Hide
          dan.j.allen Dan Allen added a comment -

          There's the term I was searching for!

          Show
          dan.j.allen Dan Allen added a comment - There's the term I was searching for!

            People

            • Assignee:
              dan.j.allen Dan Allen
              Reporter:
              dan.j.allen Dan Allen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development