# Business Logic — BeanMap.pair() [5 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW01021SF.BeanMap` |
| Layer | Utility |
| Module | `KKW01021SF` (Package: `eo.web.webview.KKW01021SF`) |

## 1. Role

### BeanMap.pair()

The `pair()` method is a fluent-builder helper on the `BeanMap` inner class, which itself is a `HashMap<String, Object>`. It inserts a single key-value pair into the map and returns the same `BeanMap` instance (`this`) so that multiple calls can be chained in a single expression. This enables concise, readable data construction patterns such as `new BeanMap().pair("key1", val1).pair("key2", val2)`.

The method serves as the core data-population primitive for building screen parameter maps, form-model maps, and intermediate data containers across dozens of screen logic classes. Every screen entry point in the KKA152xx, KKW010xx, KKSV02xx, and related modules relies on this fluent builder to assemble the key-value pairs that drive view rendering, validation, and downstream service calls.

Design pattern: **Fluent Interface / Method Chaining** combined with the **Builder pattern** — each call returns `this` so callers can construct complex map data structures in a single statement without intermediate variable assignments. It plays the role of a **shared utility** used broadly across the web presentation layer.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["pair(item, value)"])
    STEP1["super.put(item, value)"]
    STEP2["return this"]
    END_NODE(["End"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> END_NODE
```

The method has no conditional branches, loops, or conditional logic. It performs a single map insertion followed by a self-return, enabling fluent chaining.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `item` | `String` | The map key — a configuration constant string (e.g., `SELECTED_WRIV_SVC_CD`, screen data field identifiers) that identifies a business data element. The key maps to a named property used by downstream screen logic or view templates. |
| 2 | `value` | `Object` | The data value associated with the key. Can be any type: String, Integer, List, Boolean, or complex objects. The actual type depends on the caller's business context (e.g., a selected service code, a boolean flag, a campaign list). |

**Read external state:**
| No | Field | Description |
|----|-------|-------------|
| 1 | `this` (super class `HashMap<String, Object>`) | The parent HashMap is read via `super.put()` to insert the new entry into the existing map. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `super.put(item, value)` | — | `HashMap<String, Object>` (in-memory) | Retrieves the current `BeanMap` instance (the parent `HashMap`) and stores the key-value pair in memory. No database or external service interaction. |

**Note:** This method performs no database operations. It operates purely on in-memory Java HashMap state, making it an O(1) map insertion.

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 29 methods.
Terminal operations from this method: -

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Caller: `Mover.getBeanMapFromDataBean()` | `getBeanMapFromDataBean()` -> `BeanMap.pair` | - |
| 2 | Screen: `KKA15101SF` | `actionConfirm()` -> `BeanMap.pair` | - |
| 3 | Screen: `KKA15101SF` | `actionInit()` -> `BeanMap.pair` | - |
| 4 | Screen: `KKA15101SF` | `editWribCampaignList()` -> `BeanMap.pair` | - |
| 5 | Screen: `KKA15101SF` | `overwriteDataBeanForConfirm()` -> `BeanMap.pair` | - |
| 6 | Screen: `KKA15201SF` | `actionConfirm()` -> `BeanMap.pair` | - |
| 7 | Screen: `KKA15201SF` | `actionInit()` -> `BeanMap.pair` | - |
| 8 | Screen: `KKA15201SF` | `actionInitKKW01021()` -> `BeanMap.pair` | - |
| 9 | Screen: `KKA15201SF` | `editWribCampaignList1()` -> `BeanMap.pair` | - |
| 10 | Screen: `KKA15201SF` | `overwriteDataBean()` -> `BeanMap.pair` | - |
| 11 | Mapper: `KKSV0234_KKSV0234OPDBMapper` | `getKKSV023401CC()` -> `BeanMap.pair` | - |
| 12 | Mapper: `KKSV0240_KKSV0240OPDBMapper` | `getKKSV024001CC()` -> `BeanMap.pair` | - |
| 13 | Screen: `KKW01001SF` | `generateStubData()` -> `BeanMap.pair` | - |
| 14 | Screen: `KKW01021SF` | `actionAdd()` -> `BeanMap.pair` | - |
| 15 | Screen: `KKW01021SF` | `actionBulkDelete()` -> `BeanMap.pair` | - |

**Summary:** This method is called by 29+ methods across 10+ screen logic classes (`KKA15101SF`, `KKA15201SF`, `KKW01021SF`, `KKW01024SF`, `KKW01030SF`, `KKW01031SF`, `KKW01033SF`), mapper classes (`KKSV0234`, `KKSV0240`), and the utility class `Mover`. It is a foundational utility used to assemble data maps during screen initialization, confirmation, update, and delete operations — particularly for web view (SF = Screen Form) data binding.

## 6. Per-Branch Detail Blocks

**Block 1** — [METHOD] `(start of method body)` (L1066)

> Execute the put operation on the parent HashMap.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.put(item, value);` // Inserts the key-value pair into the parent HashMap via the inherited put() method |

**Block 2** — [RETURN] `(return this)` (L1067)

> Return the current BeanMap instance to enable method chaining.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return this;` // Returns self for fluent interface chaining |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `BeanMap` | Class | A HashMap-based wrapper class (`HashMap<String, Object>`) that provides a fluent builder API (`pair()`) for constructing key-value data maps used in screen logic and view binding. |
| `pair()` | Method | Fluent builder method that inserts a key-value pair into the map and returns `this` for chaining. |
| `item` | Parameter | The map key — a String identifier (often a constant) representing a business data field or configuration property. |
| `value` | Parameter | The data value associated with the key, typed as Object to support any data type. |
| `BeanMap(item, value)` (constructor) | Method | Constructor that copies an existing HashMap into the BeanMap instance. |
| `take()` | Method | The symmetric retrieval counterpart to `pair()` — retrieves a value by its key string from the map. |
| `Mover` | Class | Utility class (inner class in same source file) that converts DataBeans into BeanMap instances using `pair()`. |
| `DEFAULT_HASH_SIZE` | Constant | The default initial capacity (50) for the BeanMap's underlying HashMap. |
| `KKW01021SF` | Module | Screen form logic module — a web screen controller for service detail viewing operations. |
| SF | Acronym | Screen Form — a screen-level logic class handling action dispatch for a specific web view. |
