/** * Returns a stack manipulation that loads a {@link java.lang.Class} type onto the operand stack which * represents the given type. * * @param typeDescription The type to load onto the operand stack. * @return The corresponding stack manipulation. */ public static StackManipulation of(TypeDescription typeDescription) { if (!typeDescription.isPrimitive()) { return new ForReferenceType(typeDescription); } else if (typeDescription.represents(boolean.class)) { return BOOLEAN; } else if (typeDescription.represents(byte.class)) { return BYTE; } else if (typeDescription.represents(short.class)) { return SHORT; } else if (typeDescription.represents(char.class)) { return CHARACTER; } else if (typeDescription.represents(int.class)) { return INTEGER; } else if (typeDescription.represents(long.class)) { return LONG; } else if (typeDescription.represents(float.class)) { return FLOAT; } else if (typeDescription.represents(double.class)) { return DOUBLE; } else { return VOID; } }