chapter_005/src/main/java/ru/job4j/blocking/NonBlockingCache.java
/**
     * Update element in the store.
     *
     * @param model
     */
Update element in the store.
@param model
Update element in the store . @param model
public void update(Base model) {
        this.store.computeIfPresent(model.getId(), (key, value) -> {
            if (model.getVersion() != this.store.get(model.getId()).getVersion()) {
                try {
                    throw new OptinisticException();
                } catch (OptinisticException e) {
                    e.printStackTrace();
                }
            }
            return model.incrementVersion();
        });
    }
public void update ( Base model ) { this . store . computeIfPresent ( model . getId ( ) , ( key , value ) -> { if ( model . getVersion ( ) != this . store . get ( model . getId ( ) ) . getVersion ( ) ) { try { throw new OptinisticException ( ) ; } catch ( OptinisticException e ) { e . printStackTrace ( ) ; } } return model . incrementVersion ( ) ; } ) ; }
Update element in the store.
Update element in the store .