Java Code Examples for org.apache.olingo.odata2.api.uri.KeyPredicate#getProperty()

The following examples show how to use org.apache.olingo.odata2.api.uri.KeyPredicate#getProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ListsProcessor.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
private static Map<String, Object> mapKey(final List<KeyPredicate> keys) throws EdmException {
  Map<String, Object> keyMap = new HashMap<String, Object>();
  for (final KeyPredicate key : keys) {
    final EdmProperty property = key.getProperty();
    final EdmSimpleType type = (EdmSimpleType) property.getType();
    keyMap.put(property.getName(), type.valueOfString(key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(),
        type.getDefaultType()));
  }
  return keyMap;
}
 
Example 2
Source File: ListsProcessor.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
private static Map<String, Object> mapKey(final List<KeyPredicate> keys) throws EdmException {
  Map<String, Object> keyMap = new HashMap<String, Object>();
  for (final KeyPredicate key : keys) {
    final EdmProperty property = key.getProperty();
    final EdmSimpleType type = (EdmSimpleType) property.getType();
    keyMap.put(property.getName(), type.valueOfString(key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(),
        type.getDefaultType()));
  }
  return keyMap;
}
 
Example 3
Source File: CarODataSingleProcessor.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
private int getKeyValue(final KeyPredicate key) throws ODataException {
  EdmProperty property = key.getProperty();
  EdmSimpleType type = (EdmSimpleType) property.getType();
  return type.valueOfString(key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(), Integer.class);
}
 
Example 4
Source File: MyODataSingleProcessor.java    From wildfly-camel with Apache License 2.0 4 votes vote down vote up
private int getKeyValue(KeyPredicate key) throws ODataException {
    EdmProperty property = key.getProperty();
    EdmSimpleType type = (EdmSimpleType) property.getType();
    return type.valueOfString(key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(), Integer.class);
}