private static String getValueAsString(String key, ClientEntity transport) { ClientProperty property = transport.getProperty(key); if(property == null) return null; ClientValue value = property.getValue(); if(value == null) return null; return value.toString(); }
private static String getValueAsString(String key, ClientEntity transport) { ClientProperty property = transport.getProperty(key); if(property == null) return null; ClientValue value = property.getValue(); if(value == null) return null; return value.toString(); }
@Override protected ClientProperty getInternalProperty(final String name) { return getEntity() == null ? null : getEntity().getProperty(name); }
@Override protected ClientProperty getInternalProperty(final String name) { return getEntity() == null ? null : getEntity().getProperty(name); }
response = request.execute(); ClientEntity body = response.getBody(); String changeId = body.getProperty("ChangeID").getValue().toString(); if(!changeID.equals(changeId)) throw new RuntimeException( format("ChangeId contained in server response ('%s') does not match request change (%s).", changeId, changeID)); boolean isInDevelopment = Boolean.valueOf(body.getProperty("IsInDevelopment").getValue().toString()); logger.debug(format("Change '%s' found. isInDevelopment: '%b'", changeID, isInDevelopment)); return new CMODataChange(changeID, isInDevelopment);
response = request.execute(); ClientEntity body = response.getBody(); String changeId = body.getProperty("ChangeID").getValue().toString(); if(!changeID.equals(changeId)) throw new RuntimeException( format("ChangeId contained in server response ('%s') does not match request change (%s).", changeId, changeID)); boolean isInDevelopment = Boolean.valueOf(body.getProperty("IsInDevelopment").getValue().toString()); logger.debug(format("Change '%s' found. isInDevelopment: '%b'", changeID, isInDevelopment)); return new CMODataChange(changeID, isInDevelopment);
public static Object getKey( final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Class<?> entityTypeRef, final ClientEntity entity) { Object res = null; if (!entity.getProperties().isEmpty()) { final Class<?> keyRef = ClassUtils.getCompoundKeyRef(entityTypeRef); if (keyRef == null) { final ClientProperty property = entity.getProperty(firstValidEntityKey(entityTypeRef)); if (property != null && property.hasPrimitiveValue()) { res = primitiveValueToObject( property.getPrimitiveValue(), getPropertyClass(entityTypeRef, property.getName())); } } else { try { res = keyRef.newInstance(); populate(client, typeHandler, res, CompoundKeyElement.class, entity.getProperties().iterator()); } catch (Exception e) { LOG.error("Error population compound key {}", keyRef.getSimpleName(), e); throw new IllegalArgumentException("Cannot populate compound key"); } } } return res; }
public static Object getKey( final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Class<?> entityTypeRef, final ClientEntity entity) { Object res = null; if (!entity.getProperties().isEmpty()) { final Class<?> keyRef = ClassUtils.getCompoundKeyRef(entityTypeRef); if (keyRef == null) { final ClientProperty property = entity.getProperty(firstValidEntityKey(entityTypeRef)); if (property != null && property.hasPrimitiveValue()) { res = primitiveValueToObject( property.getPrimitiveValue(), getPropertyClass(entityTypeRef, property.getName())); } } else { try { res = keyRef.newInstance(); populate(client, typeHandler, res, CompoundKeyElement.class, entity.getProperties().iterator()); } catch (Exception e) { LOG.error("Error population compound key {}", keyRef.getSimpleName(), e); throw new IllegalArgumentException("Cannot populate compound key"); } } } return res; }
private List<ClientAnnotation> internalAnnotations() { List<ClientAnnotation> result = Collections.<ClientAnnotation> emptyList(); if (targetHandler.getInternal() instanceof ClientEntity) { result = propName == null ? ((ClientEntity) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientEntity) targetHandler.getInternal()).getProperty(propName).getAnnotations(); } else if (targetHandler.getInternal() instanceof ClientComplexValue) { result = propName == null ? ((ClientComplexValue) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientComplexValue) targetHandler.getInternal()).get(propName).getAnnotations(); } return result; }
private List<ClientAnnotation> internalAnnotations() { List<ClientAnnotation> result = Collections.<ClientAnnotation> emptyList(); if (targetHandler.getInternal() instanceof ClientEntity) { result = propName == null ? ((ClientEntity) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientEntity) targetHandler.getInternal()).getProperty(propName).getAnnotations(); } else if (targetHandler.getInternal() instanceof ClientComplexValue) { result = propName == null ? ((ClientComplexValue) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientComplexValue) targetHandler.getInternal()).get(propName).getAnnotations(); } return result; }
entry.getValue().getAnnotations(), entity.getProperty(entry.getKey()));
entry.getValue().getAnnotations(), entity.getProperty(entry.getKey()));