in-memory-store
ConcurrentHashMap CRUD pattern for the Spring MVC demo. Use when adding a new resource type with in-memory CRUD.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
ConcurrentHashMap CRUD pattern for the Spring MVC demo. Use when adding a new resource type with in-memory CRUD.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Team quality gate as executable instruction. Use when reviewing completed work before merge, or when processing PR review comments received from other reviewers.
Generate well-formed user stories from technical context. Use when generating or improving story descriptions for an issue tracker.
Type-safe validated configuration properties from application.yml. Use when adding any externalisable value.
Consistent error handling with named exceptions and global handler. Use when implementing any method that can fail with a business reason.
Consistent, safe log statements with correct levels and no PII. Use when adding or reviewing log statements.
Team standard for improving existing code without changing behaviour. Use when refactoring code.
| name | in-memory-store |
| description | ConcurrentHashMap CRUD pattern for the Spring MVC demo. Use when adding a new resource type with in-memory CRUD. |
ConcurrentHashMap in the service@Service
public class [Resource]Service {
private final Map<UUID, [Resource]> store = new ConcurrentHashMap<>();
public [Resource] create(Create[Resource]Request request) {
UUID id = UUID.randomUUID();
[Resource] item = new [Resource](id, request.name(), ...);
store.put(id, item);
return item;
}
public [Resource] getById(UUID id) {
[Resource] item = store.get(id);
if (item == null) throw new [Resource]NotFoundException(id);
return item;
}
public void delete(UUID id) {
if (store.remove(id) == null) throw new [Resource]NotFoundException(id);
}
}
ConcurrentHashMap — thread-safe without external locking.UUID.randomUUID() for every new ID — never accept IDs from the client.store.remove(id) == null is the idiomatic not-found check for delete.new ArrayList<>(store.values()) for list — returns a snapshot, safe to return.UUID.randomUUID()ProductRepository interface — the map is the store