com.github.atdixon.vroom.coercion.Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vroom Show documentation
Show all versions of vroom Show documentation
Work immutably, robustly and in a knowledge-oriented way with Entity maps in Java.
package com.github.atdixon.vroom.coercion;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
public final class Util {
private Util() {}
static Class rawTypeOf(Type type) {
if (type instanceof Class) {
return (Class) type;
} else if (type instanceof ParameterizedType) {
return (Class) ((ParameterizedType) type).getRawType();
} else {
throw new IllegalArgumentException();
}
}
}