Example usage for com.google.gwt.dev.asm Type LONG

List of usage examples for com.google.gwt.dev.asm Type LONG

Introduction

In this page you can find the example usage for com.google.gwt.dev.asm Type LONG.

Prototype

int LONG

To view the source code for com.google.gwt.dev.asm Type LONG.

Click Source Link

Document

The sort of the long type.

Usage

From source file:com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.java

License:Apache License

/**
 * This looks like it should be a utility method somewhere else, but I can't
 * find it./*  ww  w.jav  a2 s  .  c  o  m*/
 */
private Type getBoxedType(Type primitive) {
    switch (primitive.getSort()) {
    case Type.BOOLEAN:
        return Type.getType(Boolean.class);
    case Type.BYTE:
        return Type.getType(Byte.class);
    case Type.CHAR:
        return Type.getType(Character.class);
    case Type.DOUBLE:
        return Type.getType(Double.class);
    case Type.FLOAT:
        return Type.getType(Float.class);
    case Type.INT:
        return Type.getType(Integer.class);
    case Type.LONG:
        return Type.getType(Long.class);
    case Type.SHORT:
        return Type.getType(Short.class);
    case Type.VOID:
        return Type.getType(Void.class);
    }
    throw new RuntimeException(primitive.getDescriptor() + " is not a primitive type");
}

From source file:com.google.web.bindery.requestfactory.server.ResolverServiceLayer.java

License:Apache License

private Class<?> getClass(Type type) {
    switch (type.getSort()) {
    case Type.BOOLEAN:
        return boolean.class;
    case Type.BYTE:
        return byte.class;
    case Type.CHAR:
        return char.class;
    case Type.DOUBLE:
        return double.class;
    case Type.FLOAT:
        return float.class;
    case Type.INT:
        return int.class;
    case Type.LONG:
        return long.class;
    case Type.OBJECT:
        return forName(type.getClassName());
    case Type.SHORT:
        return short.class;
    case Type.VOID:
        return void.class;
    case Type.ARRAY:
        return die(null, "Unsupported Type used in operation descriptor %s", type.getDescriptor());
    default://from   ww  w.  j  a  va2 s.  c om
        // Error in this switch statement
        return die(null, "Unhandled Type: %s", type.getDescriptor());
    }
}