Helper method. Returns typed property data.

@param <T> type
@param key the key
@param type the texture type
@param index the texture index
@param clazz type
@return the data
192022
private <T> T getTyped(PropertyKey key, AiTextureType type, int index, 
            Class<T> clazz) {
        
        Property p = getProperty(key.m_key, AiTextureType.toRawValue(type), 
                index);
        
        if (null == p || null == p.getData()) {
            return clazz.cast(m_defaults.get(key));
        }
        
        return clazz.cast(p.getData());
    }
1313015
public <T> T getOutputValue (String key, Class<T> type)
	{
		try {
			String s = mapper.writeValueAsString(_findOutputValue(key));
			return (mapper.readValue(s, type));
		}
		catch (IOException e) {
			return null;
		}
	}
60440
public <T> T get(String key, Class<T> type) {
        Object value = this.data.get(key);
        if (value != null && type.isAssignableFrom(value.getClass())) {
            return (T) value;
        }
        return null;
    }
537512
public Integer getTextureMagFilter(AiTextureType type, int index) {
        checkTexRange(type, index);

        Property p = getProperty(PropertyKey.TEX_MAG_FILTER.m_key);

        if (null == p || null == p.getData()) {
            return (Integer) m_defaults.get(PropertyKey.TEX_MAG_FILTER);
        }
        Object rawValue = p.getData();
        if (rawValue instanceof java.nio.ByteBuffer)
        {
            java.nio.IntBuffer ibuf = ((java.nio.ByteBuffer) rawValue).asIntBuffer();
            return ibuf.get();
        }
        else
        {
            return (Integer) rawValue;
        }
    }
694573
private Map<String, Object> getEntity(String type, String id) throws StorageException {
        try {
            JestResult response = esClient.execute(new Get.Builder(getIndexName(), id).type(type).build());
            if (!response.isSucceeded()) {
                return null;
            }
            return response.getSourceAsObject(Map.class);
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
1162329
public static Type getParamType(Method method, int index) {
		Type[] types = getParamTypes(method);
		if (null != types && types.length > index) {
			return types[index];
		}
		return null;
	}
876899
public Property getProperty(String key, int semantic, int index) {
        for (Property property : m_properties) {
            if (property.getKey().equals(key) && 
                    property.m_semantic == semantic && 
                    property.m_index == index) {
                
                return property;
            }
        }
        
        return null;
    }
674083
@Override
    public String getAttributeType(int index)
    {
        DTDAttribute attr = mAttrSpecs[index];
        return (attr == null) ? WstxInputProperties.UNKNOWN_ATTR_TYPE : 
            attr.getValueTypeString();
    }
1086627
private <T extends Index> List<T> listIndexType(String type, Class<T> modelType) {
        List<T> indexesOfType = new ArrayList<T>();
        Gson g = new Gson();
        for (JsonElement index : indexes) {
            if (index.isJsonObject()) {
                JsonObject indexDefinition = index.getAsJsonObject();
                JsonElement indexType = indexDefinition.get("type");
                if (indexType != null && indexType.isJsonPrimitive()) {
                    JsonPrimitive indexTypePrimitive = indexType.getAsJsonPrimitive();
                    if (type == null || (indexTypePrimitive.isString() && indexTypePrimitive
                            .getAsString().equals(type))) {
                        indexesOfType.add(g.fromJson(indexDefinition, modelType));
                    }
                }
            }
        }
        return indexesOfType;
    }
937923
public static Map<TypeVariable, Type> getTypeVariableMap(Class<?> clazz) {
		Map<TypeVariable, Type> typeVariableMap = typeVariableCache.get(clazz);

		if (typeVariableMap == null) {
			typeVariableMap = new HashMap<TypeVariable, Type>();

			// interfaces
			extractTypeVariablesFromGenericInterfaces(clazz.getGenericInterfaces(), typeVariableMap);

			try {
				// super class
				Class<?> type = clazz;
				while (type.getSuperclass() != null && !Object.class.equals(type.getSuperclass())) {
					Type genericType = type.getGenericSuperclass();
					if (genericType instanceof ParameterizedType) {
						ParameterizedType pt = (ParameterizedType) genericType;
						populateTypeMapFromParameterizedType(pt, typeVariableMap);
					}
					extractTypeVariablesFromGenericInterfaces(type.getSuperclass().getGenericInterfaces(), typeVariableMap);
					type = type.getSuperclass();
				}
			}
			catch (MalformedParameterizedTypeException ex) {
				// from getGenericSuperclass() - ignore and continue with member class check
			}

			try {
				// enclosing class
				Class<?> type = clazz;
				while (type.isMemberClass()) {
					Type genericType = type.getGenericSuperclass();
					if (genericType instanceof ParameterizedType) {
						ParameterizedType pt = (ParameterizedType) genericType;
						populateTypeMapFromParameterizedType(pt, typeVariableMap);
					}
					type = type.getEnclosingClass();
				}
			}
			catch (MalformedParameterizedTypeException ex) {
				// from getGenericSuperclass() - ignore and preserve previously accumulated type variables
			}

			typeVariableCache.put(clazz, typeVariableMap);
		}

		return typeVariableMap;
	}
469399
public <T> T getAttribute(String key, Class<T> clazz) {
        return (T) getAttribute(key);
    }
710788
protected <T> T getProperty(String key, Class<T> type) {
        Object returnValue = getProperty(key);
        if (returnValue != null) {
            return (T) returnValue;
        } else {
            return null;
        }
    }
629904
public static Object getValue(Result result, int index,
			GeoPackageDataType dataType) {

		Object value = null;

		int type = result.getType(index);

		switch (type) {

		case FIELD_TYPE_INTEGER:
			value = getIntegerValue(result, index, dataType);
			break;

		case FIELD_TYPE_FLOAT:
			value = getFloatValue(result, index, dataType);
			break;

		case FIELD_TYPE_STRING:
			String stringValue = result.getString(index);

			if (dataType != null
					&& (dataType == GeoPackageDataType.DATE || dataType == GeoPackageDataType.DATETIME)) {
				DateConverter converter = DateConverter.converter(dataType);
				try {
					value = converter.dateValue(stringValue);
				} catch (Exception e) {
					logger.log(Level.WARNING,
							"Invalid " + dataType + " format: " + stringValue
									+ ", String value used", e);
					value = stringValue;
				}
			} else {
				value = stringValue;
			}
			break;

		case FIELD_TYPE_BLOB:
			value = result.getBlob(index);
			break;

		case FIELD_TYPE_NULL:
			// leave value as null
		}

		return value;
	}
975664
@SuppressWarnings("unchecked")
  @Nullable
  public <T> T get(Key<T> key) {
    return (T) data.get(key);
  }
1126608
public String sendData(String jsonSource, String index, String type) {
        return sendData(jsonSource, index, type, null).getId();
    }
130686
public DataType getAttributeType(int index) {
        final VertexAttribute attribute = getAttribute(index);
        if (attribute == null) {
            return null;
        }
        return attribute.getType();
    }
135507
public static Datatype getDatatype(String datatypeKey) 
	{	
		Datatype dt = null;
		if(containsIdOrName(datatypeKey))
			dt = datatypesHash.get(datatypeKey.toUpperCase());
		else if(containsUri(datatypeKey)) 
			dt = datatypesHash.get(datatypeKey);
		else
			throw new IllegalArgumentException("Datatype not found : " + datatypeKey);
		
		if(!useObsoleteDatatypes 
				&& dt.isObsolete() != null 
				&& dt.isObsolete().booleanValue() == true)
			throw new IllegalArgumentException("Datatype " +
				datatypeKey + "(" + dt.getName() + ") is obsolete" +
					" (and useObsoleteDatatypes=false)");
		
		// return 
		return dt;
	}