Get the data model for the given type.

@param <E> The entity type
@param type The Java class of the entity type
@return The appropriate data model for the given type
188323
public static <E> GenericData getDataModelForType(Class<E> type) {
    // Need to check if SpecificRecord first because specific records also
    // implement GenericRecord
    if (SpecificRecord.class.isAssignableFrom(type)) {
      return new SpecificData(type.getClassLoader());
    } else if (IndexedRecord.class.isAssignableFrom(type)) {
      return GenericData.get();
    } else {
      return AllowNulls.get();
    }
  }
1001710
LevelDBTypeInfo getTypeInfo(Class<?> type) throws Exception {
    LevelDBTypeInfo ti = types.get(type);
    if (ti == null) {
      LevelDBTypeInfo tmp = new LevelDBTypeInfo(this, type, getTypeAlias(type));
      ti = types.putIfAbsent(type, tmp);
      if (ti == null) {
        ti = tmp;
      }
    }
    return ti;
  }
562449
protected TableMetadata createMetadata(final ConnectionManager connectionManager,
			final Class<? extends Object> type)
			throws SQLException {
		Table table = getTable(type);
		return TableMetadata.createTableEntityMetadata(connectionManager, table);
	}
1154818
public static <T> TypeReference<T> get(Class<T> type) {
		return new SimpleTypeReference<T>(type);
	}
1165942
public Optional<MapperInstance> getSerializer( JType type ) {
        return Optional.fromNullable( serializers.get( type.getQualifiedSourceName() ) );
    }
1190737
public static final String getString(Type type) {
        if (type instanceof GenericObjectType) {
            return ((GenericObjectType) type).toString(true);
        } else if (type instanceof ArrayType) {
            return TypeCategory.asString((ArrayType) type);
        } else {
            return type.toString();
        }
    }
1176235
public <T> T get(Class<T> type) {
        return get(type.getName(), type);
    }
1226389
public final <T> SerializerJson<T> serializer(Type type)
  {
    SerializerJson<T> ser = (SerializerJson<T>) _serTypeMap.get(type);
    
    if (ser == null) {
      TypeRef typeRef = TypeRef.of(type);
      Class<T> rawClass = (Class<T>) typeRef.rawClass();
      
      ser = serializer(rawClass).withType(typeRef, this);
      
      _serTypeMap.putIfAbsent(type, ser);
      
      ser = (SerializerJson<T>) _serTypeMap.get(type);
    }
    
    return ser;
  }
675424
public static EntityDescriptor create(String id, ModelType type) {
        return create(ModelId.of(id), type);
    }
23622
private static String getGenericTypeData(Type genericType) {
    List<String> types = Lists.newArrayList();
    if (genericType != null && genericType instanceof ParameterizedType) {
      for (Type t : ((ParameterizedType) genericType).getActualTypeArguments()) {
        if (t instanceof ParameterizedType) {
          String nestedGeneric = ((Class<?>) ((ParameterizedType) t).getRawType()).getSimpleName();
          nestedGeneric += getGenericTypeData(t);
          types.add(nestedGeneric);
        } else {
          types.add(((Class<?>) t).getSimpleName());
        }
      }
    }
    return (types.size() > 0) ? "<" + Joiner.on(", ").join(types) + ">" : "";
  }
391164
public static Class<?> classFromAsmType(Type type) {
    Optional<Class<?>> maybeClass = objectTypeToClassCache.getUnchecked(type);
    if (!maybeClass.isPresent()) {
      throw new IllegalArgumentException("Could not load: " + type);
    }
    return maybeClass.get();
  }
1026716
@SuppressWarnings("unchecked")
    public EntityFunction resolveType(final Class<? extends Entity> type) {
	// Check already resolved
	EntityFunction resolvedType = resolved.get(Objects.requireNonNull(type));
	if (resolvedType != null) {
	    return resolvedType;
	}

	// Log type
	logger.info(String.format("Resolving type %s", type));

	// Check not entity
	if (Entity.class.equals(type)) {
	    throw new IllegalArgumentException("Entity is not a valid Entity subclass");
	}

	// Check is interface
	if (!type.isInterface()) {
	    throw new IllegalArgumentException(String.format("Type %s is not an interface", type));
	}

	// Check type parameters
	if (type.getTypeParameters().length > 0) {
	    throw new IllegalArgumentException(String.format("Type %s cannot take type parameters", type));
	}

	// Build method map
	final Map<Method, EntityMethod> methodMap = new HashMap<>();
	final Set<Class<? extends Entity>> totalDependencies = new HashSet<>();
	for (final Method m : type.getDeclaredMethods()) {
	    // Check static
	    if (Modifier.isStatic(m.getModifiers())) {
		// Ignore static methods as not invoked on instance
		continue;
	    }
	    // Process functions
	    for (final EntityMethodFunction methodFunction : functions) {
		// Log method
		logger.fine(String.format("Resolving method %s with function %s", m, methodFunction.getClass()));
		// Resolve method
		final EntityMethod em = methodFunction.apply(m);
		if (em != null) {
		    // Resolved method
		    if (methodMap.put(m, em) != null) {
			throw new IllegalArgumentException(
				String.format("Method %s of type %s had multiple function hits", m, type));
		    }
		    // Add dependencies to be resolved
		    totalDependencies.addAll(em.getDependencies());
		}
	    }
	    // Check method could be resolved
	    if (!methodMap.containsKey(m)) {
		throw new IllegalArgumentException(String.format("Method %s of type %s had no resolver hits", m, type));
	    }
	}

	// Created resolved type
	resolvedType = new EntityFunction(type, methodMap);
	resolved.put(type, resolvedType);

	// Resolve dependencies
	totalDependencies.forEach(this::resolveType);

	// Resolve parents
	for (final Class<?> parent : type.getInterfaces()) {
	    // Ignore if entity
	    if (Entity.class.equals(parent)) {
		continue;
	    }

	    // Check if entity subclass
	    if (!Entity.class.isAssignableFrom(parent)) {
		throw new IllegalArgumentException(
			String.format("Parent type %s of type %s is not an Entity", parent, type));
	    }

	    // Resolve dependency
	    resolveType((Class<? extends Entity>) parent);
	}

	return resolvedType;
    }
731579
public static <X> BasicTypeInfo<X> getInfoFor(Class<X> type) {
		if (type == null) {
			throw new NullPointerException();
		}
		
		@SuppressWarnings("unchecked")
		BasicTypeInfo<X> info = (BasicTypeInfo<X>) TYPES.get(type);
		return info;
	}
446211
@Override
    public <T> T get(Class<T> type) {
        Validate.notNull(type, "Type must be specified");

        return type.cast(store.get(type));
    }
205699
public static Table getTable(final Class<?> entityType) {
		jp.co.future.uroborosql.mapping.annotations.Table table = entityType.getAnnotation(
				jp.co.future.uroborosql.mapping.annotations.Table.class);
		if (table != null) {
			return new TableImpl(table.name(), table.schema());
		}
		String baseName = entityType.getSimpleName();
		if (baseName.endsWith("Entity")) {
			baseName = baseName.substring(0, baseName.length() - 6);
		}
		return new TableImpl(CaseFormat.UPPER_SNAKE_CASE.convert(baseName), "");
	}
713775
public <T> TypeAdapter<T> getAdapter(Class<T> type) {
    return getAdapter(TypeToken.get(type));
  }
1249746
public void setModelType(ModelType type) {
		this.modelType = type;

		if (type != ModelType.AUTO) {
			this.type = type.getJsName();
		}
		else {
			this.type = null;
		}
	}