use of com.github.davidmoten.odata.client.generator.model.KeyElement in project odata-client by davidmoten.
the class Generator method getKeyInfo.
private KeyInfo getKeyInfo(EntityType et, Imports imports) {
Optional<KeyElement> firstKey = et.getFirstKey();
if (!firstKey.isPresent()) {
return new KeyInfo("", "");
} else {
KeyElement key = et.getFirstKey().get();
String typedParams = //
key.getPropertyRefs().stream().map(//
PropertyRef::getReferredProperty).map(//
z -> String.format("%s %s", z.getImportedType(imports), z.getFieldName())).collect(Collectors.joining(", "));
String addKeys = getAddKeys(et, imports, key);
return new KeyInfo(typedParams, addKeys);
}
}
Aggregations