private static void addAttributeResponses( final Map<String, JsonifiableMapper<ThingModifyCommandResponse>> mappingStrategies) { mappingStrategies.put(ModifyAttributesResponse.TYPE, adaptable -> isCreated(adaptable) ? ModifyAttributesResponse.created(thingIdFrom(adaptable), attributesFrom(adaptable), dittoHeadersFrom(adaptable)) : ModifyAttributesResponse.modified(thingIdFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(DeleteAttributesResponse.TYPE, adaptable -> DeleteAttributesResponse.of(thingIdFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(ModifyAttributeResponse.TYPE, adaptable -> isCreated(adaptable) ? ModifyAttributeResponse.created(thingIdFrom(adaptable), attributePointerFrom(adaptable), attributeValueFrom(adaptable), dittoHeadersFrom(adaptable)) : ModifyAttributeResponse.modified(thingIdFrom(adaptable), attributePointerFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(DeleteAttributeResponse.TYPE, adaptable -> DeleteAttributeResponse.of(thingIdFrom(adaptable), attributePointerFrom(adaptable), dittoHeadersFrom(adaptable))); }
private static void addAttributeResponses( final Map<String, JsonifiableMapper<ThingModifyCommandResponse>> mappingStrategies) { mappingStrategies.put(ModifyAttributesResponse.TYPE, adaptable -> isCreated(adaptable) ? ModifyAttributesResponse.created(thingIdFrom(adaptable), attributesFrom(adaptable), dittoHeadersFrom(adaptable)) : ModifyAttributesResponse.modified(thingIdFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(DeleteAttributesResponse.TYPE, adaptable -> DeleteAttributesResponse.of(thingIdFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(ModifyAttributeResponse.TYPE, adaptable -> isCreated(adaptable) ? ModifyAttributeResponse.created(thingIdFrom(adaptable), attributePointerFrom(adaptable), attributeValueFrom(adaptable), dittoHeadersFrom(adaptable)) : ModifyAttributeResponse.modified(thingIdFrom(adaptable), attributePointerFrom(adaptable), dittoHeadersFrom(adaptable))); mappingStrategies.put(DeleteAttributeResponse.TYPE, adaptable -> DeleteAttributeResponse.of(thingIdFrom(adaptable), attributePointerFrom(adaptable), dittoHeadersFrom(adaptable))); }