Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private final Map<Class<?>, ParameterConverter<Object, ?>> convertersByClass = new ImmutableMap.Builder<Class<?>, ParameterConverter<Object, ?>>()
.put(String.class, this::buildString)
.put(Integer.TYPE, this::buildPrimitiveInt)
.put(Integer.class, this::buildInteger)
.put(Long.TYPE, this::buildPrimitiveLong)
.put(Long.class, this::buildLong)
.put(Boolean.TYPE, this::buildPrimitiveBoolean)
.put(Boolean.class, this::buildBoolean)
.put(Short.TYPE, this::buildPrimitiveShort)
.put(Short.class, this::buildShort)
.put(Byte.TYPE, this::buildPrimitiveByte)
.put(Byte.class, this::buildByte)
.put(Character.TYPE, this::buildPrimitiveChar)
.put(Character.class, this::buildChar)
.put(Float.TYPE, this::buildPrimitiveFloat)
.put(Float.class, this::buildFloat)
.put(Double.TYPE, this::buildPrimitiveDouble)
.put(Double.class, this::buildDouble)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment