fixed compile error Java 8
This commit is contained in:
parent
f758bde077
commit
bfd25c9885
1 changed files with 9 additions and 5 deletions
|
@ -75,19 +75,23 @@ public class RestService {
|
||||||
return restCall.newBuilder();
|
return restCall.newBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action activation(final Action action) {
|
public <T> Action activation(final Action action) {
|
||||||
if (action.definition.restCallType == null) {
|
if (action.definition.restCallType == null) {
|
||||||
throw new IllegalArgumentException("ActionDefinition needs to define a restCallType to use this action");
|
throw new IllegalArgumentException("ActionDefinition needs to define a restCallType to use this action");
|
||||||
}
|
}
|
||||||
|
|
||||||
final RestCall<?>.RestCallBuilder builder = this.getBuilder(action.definition.restCallType);
|
@SuppressWarnings("unchecked")
|
||||||
return builder
|
final Class<? extends RestCall<T>> restCallType =
|
||||||
|
(Class<? extends RestCall<T>>) action.definition.restCallType;
|
||||||
|
|
||||||
|
this.getBuilder(restCallType)
|
||||||
.withURIVariable(
|
.withURIVariable(
|
||||||
API.PARAM_MODEL_ID,
|
API.PARAM_MODEL_ID,
|
||||||
action.pageContext().getAttribute(AttributeKeys.ENTITY_ID))
|
action.pageContext().getAttribute(AttributeKeys.ENTITY_ID))
|
||||||
.call()
|
.call()
|
||||||
.map(report -> action)
|
.onErrorDo(t -> action.pageContext().notifyError(t));
|
||||||
.getOrThrow();
|
|
||||||
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue