spring-projects / spring-projects/spring-data-keyvalue

Add support for putIfAbsent to KeyValueAdapter

Open
#688 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
157
Forks
85
PR merge metrics
No merged PRs in 30d

Description

public interface KeyValueAdapter ... {

    /**
     * Add object with given id to keyspace.
     *
     * @param id must not be {@literal null}.
     * @param keyspace must not be {@literal null}.
     * @return the item previously associated with the id.
     */
    @Nullable Object putIfAbsent(Object id, Object item, String keyspace);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the KeyValueAdapter interface and inspect how its existing operations are implemented by the repository's key-value adapters. Trace the expected behavior of the proposed putIfAbsent signature and add coverage for the previously associated item and absent-item cases; done means supported adapters expose consistent behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.