Returns the property value as a Key.

@throws DatastoreException if no such property
@throws ClassCastException if value is not a Key
172359
@SuppressWarnings("unchecked")
  public Key getKey(String name) {
    return ((Value<Key>) getValue(name)).get();
  }
1304285
@Override
	public final <T> Comparable getComparableProperty(final PropertyKey<T> key) {

		if (key != null) {

			final T propertyValue = getProperty(key);

			// check property converter
			PropertyConverter<T, ?> converter = key.databaseConverter(securityContext, this);
			if (converter != null) {

				try {
					return converter.convertForSorting(propertyValue);

				} catch (Throwable t) {

					logger.warn("Unable to convert property {} of type {}: {}", new Object[]{
						key.dbName(),
						getClass().getSimpleName(),
						t.getMessage()
					});

					logger.warn("", t);
				}
			}

			// conversion failed, may the property value itself is comparable
			if (propertyValue instanceof Comparable) {
				return (Comparable) propertyValue;
			}

			// last try: convertFromInput to String to make comparable
			if (propertyValue != null) {
				return propertyValue.toString();
			}
		}

		return null;
	}
1098780
@Override
    public synchronized Object getValue() {
        if (id != null) {
            if (serializedValue != null) {
                long oldSize = -1;
                if (cacheEntryPool != null) {
                    if (cacheEntryPool.cache.isCacheSizeInMBEnabled()) {
                        oldSize = getObjectSize();
                    }
                }

                try {
                    value = SerializationUtility.deserialize(serializedValue, cacheName);
                } catch (Exception ex) {
                    com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.CacheEntry.getValue", "200", this);
                }
                if (value != null) {
                    serializedValue = null;
                    if (cacheEntryPool != null) {
                        if (cacheEntryPool.cache.isCacheSizeInMBEnabled()) {
                            long newSize = getObjectSize();
                            if (oldSize != -1 && newSize != -1) {
                                cacheEntryPool.cache.increaseCacheSizeInBytes(newSize - oldSize, "GET_VALUE");
                            } else {
                                cacheEntryPool.cache.disableCacheSizeInMB();
                            }
                        }
                    }
                }
            }
        }
        return value;
    }
1025821
@SuppressWarnings({"unchecked"})
    @Nullable
    @Override
    public DataType<D> dataType() {
        String className = vertex().property(Schema.VertexProperty.DATA_TYPE);
        if (className == null) return null;

        try {
            return (DataType<D>) DataType.of(Class.forName(className));
        } catch (ClassNotFoundException e) {
            throw TransactionException.unsupportedDataType(className);
        }
    }
435597
@SuppressWarnings({ "unchecked", "rawtypes" })
	public static final <TO, FROM> TO convert(Class<TO> to, FROM from) {

		// Convert null value
		if (from == null || to == null) {
			return null;
		}

		// Convert "null" String to null
		if ("null".equals(from)) {
			return null;
		}

		// Class is same
		if (to == Object.class || from.getClass() == to) {
			return (TO) from;
		}

		// BSON conversion
		boolean isFromMap = from != null && from instanceof Map;
		if (isFromMap) {
			Object subValue = getSubValue((Map) from);
			if (subValue != null) {
				return convert(to, subValue);
			}
		}

		// Convert FROM -> TO
		DataConverterKey<TO, FROM> key = new DataConverterKey<TO, FROM>(to, (Class<FROM>) from.getClass());
		DataConverter<TO, FROM> converter = (DataConverter<TO, FROM>) converters.get(key);
		if (converter != null) {
			return converter.convert(from);
		}

		// Convert any -> TO
		converter = (DataConverter<TO, FROM>) defaultConverters.get(to);
		if (converter != null) {
			return converter.convert(from);
		}

		// Converter not found
		throw new IllegalArgumentException("Unable to convert " + from.getClass() + " to " + to
				+ ", converter not found in DataConverterRegistry!");
	}
689596
@SuppressWarnings("unchecked")
	public <T> T getSet(Object key, Object value) {
		Jedis jedis = getJedis();
		try {
			return (T)valueFromBytes(jedis.getSet(keyToBytes(key), valueToBytes(value)));
		}
		finally {close(jedis);}
	}
607628
public static Integer getIntegerProperty(Properties properties, String key) {
        String property = getStringProperty(properties, key);
        if (property == null) {
            return null;
        }
        Integer value;
        try {
            value = Integer.parseInt(property);
        } catch (RuntimeException e) {
            throw new ODataClientRuntimeException("Unable to parse property. " + property, e);
        }
        return value;
    }
972704
private byte[] idValueInByteArr()
    {
        Object entity = results.get(results.size() - 1);
        Object id = PropertyAccessorHelper.getId(entity, entityMetadata);
        String idName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
        Class idClazz = ((AbstractAttribute) entityMetadata.getIdAttribute()).getBindableJavaType();
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());

        EmbeddableType keyObj = null;
        ByteBuffer bytes = null;

        // if the key attribute is composite
        if (metaModel.isEmbeddable(entityMetadata.getIdAttribute().getBindableJavaType()))
        {
            keyObj = metaModel.embeddable(entityMetadata.getIdAttribute().getBindableJavaType());
            Field embeddedField = getPartitionKeyField();
            Attribute partitionKey = keyObj.getAttribute(embeddedField.getName());
            Object partitionKeyValue = PropertyAccessorHelper.getObject(id, (Field) partitionKey.getJavaMember());
            bytes = CassandraUtilities.toBytes(partitionKeyValue, (Field) partitionKey.getJavaMember());
        }
        else
        {
            bytes = query.getBytesValue(idName, entityMetadata, id);
        }
        return bytes.array();
    }
395728
@Override
	public V get(K key) throws CacheException {
		logger.debug("get key [" + key + "]");

		if (key == null) {
			return null;
		}

		try {
			Object redisCacheKey = getRedisCacheKey(key);
			byte[] rawValue = redisManager.get(keySerializer.serialize(redisCacheKey));
			if (rawValue == null) {
				return null;
			}
			V value = (V) valueSerializer.deserialize(rawValue);
			return value;
		} catch (SerializationException e) {
			throw new CacheException(e);
		}
	}
873746
public final Object put(Object key, Object value) {
        return internalData.put(key, value);
    }
742181
public Entity javaToDatastore(Key parentKey, Object javaObject) {
		Key key = keyProperty.getValue(javaObject);
		Entity entity = key == null? new Entity(kind, parentKey) : new Entity(key); 
		for (Entry<String, PropertyMetadata<?, ?>> entry : properties.entrySet()) {
			PropertyMetadata property = entry.getValue();
			Object javaValue = property.getValue(javaObject);
			property.setEntityValue(entity, javaValue);
		}
		return entity;
	}
1321577
private Key insert(Entity entity) throws DatastoreException {
    CommitRequest req = CommitRequest.newBuilder()
	.addMutations(Mutation.newBuilder()
	    .setInsert(entity))
        .setMode(CommitRequest.Mode.NON_TRANSACTIONAL)
	.build();
    return datastore.commit(req).getMutationResults(0).getKey();
  }
28705
@Pure
	protected AttributeValue getStoredAttributeValue(String name, AttributeType expectedType) {
		Object val = this.heap.get(name);
		if (val != null) {
			final AttributeType currentType = AttributeType.fromValue(val);
			val = unprotectNull(val);
			final AttributeValue attr = new AttributeValueImpl(name);
			if (expectedType == null) {
				attr.castAndSet(currentType, val);
			} else {
				attr.castAndSet(expectedType, val);
			}
			return attr;
		}
		return null;
	}
109821
private static PersistentProperty getGrailsDomainClassProperty(AbstractHibernateDatastore datastore, Class<?> targetClass, String propertyName) {
        PersistentEntity grailsClass = datastore != null ? datastore.getMappingContext().getPersistentEntity( targetClass.getName()) : null;
        if (grailsClass == null) {
            throw new IllegalArgumentException("Unexpected: class is not a domain class:"+targetClass.getName());
        }
        return grailsClass.getPropertyByName(propertyName);
    }
1210120
public SQLProperty getPrimaryKey() {
		for (SQLProperty item : collection) {
			if (item.isPrimaryKey()) {
				return item;
			}
		}

		// try to get id
		SQLProperty id = findPropertyByName("id");

		return id;
	}
529714
public static KeyValue getReferenceKeyValue(byte[] rowkey, String propertyName,
            String schemaName, List<BeanId> refs, UniqueIds uids) {
        final byte[] pid = uids.getUsid().getId(propertyName);
        final byte[] sid = uids.getUsid().getId(schemaName);
        final byte[] qual = new byte[] { sid[0], sid[1], pid[0], pid[1] };
        final byte[] iids = getIids2(refs, uids);
        return new KeyValue(rowkey, REF_COLUMN_FAMILY, qual, iids);
    }
660067
@Override
    public V get(Object key) {
        // Keys can not be null
        if (key == null) {
            throw new NullPointerException("Key can not be null");
        }
        if (!(key instanceof String)) {
            throw new ClassCastException("Only String keys are supported -- got " + key.getClass());
        }
        // Empty keys are stored in the root
        if (key.equals("")) {
            if (root.getRight() == null) {
                return null;
            } else {
                return root.getRight().getValue();
            }
        }

        // Find nearest node
        PatriciaNode<V> nearest = findNearestNode((String) key);

        // If the nearest node matches key, we have a match
        if (key.equals(nearest.getKey())) {
            return nearest.getValue();
        } else {
            return null;
        }
    }