Home | History | Annotate | Download | only in bytecode
      1 package org.robolectric.internal.bytecode;
      2 
      3 enum RoboType {
      4   VOID(Void.TYPE),
      5   BOOLEAN(Boolean.TYPE),
      6   BYTE(Byte.TYPE),
      7   CHAR(Character.TYPE),
      8   SHORT(Short.TYPE),
      9   INT(Integer.TYPE),
     10   LONG(Long.TYPE),
     11   FLOAT(Float.TYPE),
     12   DOUBLE(Double.TYPE),
     13   OBJECT(null);
     14 
     15   RoboType(Class type) {
     16     this.type = type;
     17   }
     18 
     19   private final Class type;
     20 
     21   public static Class findPrimitiveClass(String name) {
     22     for (RoboType type : RoboType.values()) {
     23       if (type.type != null && type.type.getName().equals(name)) {
     24         return type.type;
     25       }
     26     }
     27     return null;
     28   }
     29 }
     30