According to the documentation there are more ways than just the static valueOf
method:
- Be a primitive type;
- Have a constructor that accepts a single String argument;
- Have a static method named
valueOf
orfromString
that accepts a single String argument (see, for example,Integer.valueOf(String)
andjava.util.UUID.fromString(String)
);- Have a registered implementation of
javax.ws.rs.ext.ParamConverterProvider
JAX-RS extension SPI that returns ajavax.ws.rs.ext.ParamConverter
instance capable of a "from string" conversion for the type. or- Be
List<T>
,Set<T>
orSortedSet<T>
, whereT
satisfies 2 or 3 above. The resulting collection is read-only.
The solution using a ParamConverterProvider
should work in this case.