# Business Logic — FUW00116SF01DBean.storeModelData() [31 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00116SF.FUW00116SF01DBean` |
| Layer | DBean (Data Bean / View Data Transfer Component) |
| Module | `FUW00116SF` (Package: `eo.web.webview.FUW00116SF`) |

## 1. Role

### FUW00116SF01DBean.storeModelData()

This method serves as the **model-data binding dispatcher** for the `FUW00116SF01DBean` data bean. It is responsible for routing incoming key-subkey pairs to the appropriate setter method, thereby populating the bean's internal model data (MLAD — Mail List Array Data) with values coming from the view layer. In the telecom order management domain, this bean manages email-address-related fields: specifically the **send destination email address** (送信先メールアドレス) and the **email address setting field code** (メールアドレス設定フィールドコード). It implements the **routing/dispatch pattern** — the key parameter determines which logical field is being set, while the subkey determines whether the operation is a value assignment or a state update. This method acts as a **shared utility** within the DBean hierarchy: all `FUW00116SF*DBean` subclasses override this method with a `gamenId` parameter and delegate to the parent chain, making it the central binding point for all view-to-model data flow in this screen module. The method handles two distinct data types, each with "value" and "state" subkey variants, enabling both data population and state tracking on the same logical field.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])
    CHECK_NULL{key or subkey == null?}
    SEPARATOR["int separaterPoint = key.indexOf('/')"]
    MLAD_KEY{key equals '送信先メールアドレス'?}
    MLAD_VALUE_SUB{subkey equalsIgnoreCase 'value'?}
    MLAD_STATE_SUB{subkey equalsIgnoreCase 'state'?}
    MLAD_SET_FIELD_KEY{key equals 'メールアドレス設定フィールドコード'?}
    MLAD_SET_FIELD_VALUE_SUB{subkey equalsIgnoreCase 'value'?}
    MLAD_SET_FIELD_STATE_SUB{subkey equalsIgnoreCase 'state'?}
    MLAD_SET_VALUE["setMlad_value((String)in_value)"]
    MLAD_SET_STATE["setMlad_state((String)in_value)"]
    MLAD_SET_FIELD_CD_VALUE["setMlad_set_field_cd_value((String)in_value)"]
    MLAD_SET_FIELD_CD_STATE["setMlad_set_field_cd_state((String)in_value)"]
    RETURN(["return"])

    START --> CHECK_NULL
    CHECK_NULL --> |true| RETURN
    CHECK_NULL --> |false| MLAD_KEY
    MLAD_KEY --> |true| MLAD_VALUE_SUB
    MLAD_KEY --> |false| MLAD_SET_FIELD_KEY
    MLAD_VALUE_SUB --> |true| MLAD_SET_VALUE
    MLAD_VALUE_SUB --> |false| MLAD_STATE_SUB
    MLAD_STATE_SUB --> |true| MLAD_SET_STATE
    MLAD_STATE_SUB --> |false| RETURN
    MLAD_SET_FIELD_KEY --> |true| MLAD_SET_FIELD_VALUE_SUB
    MLAD_SET_FIELD_KEY --> |false| RETURN
    MLAD_SET_FIELD_VALUE_SUB --> |true| MLAD_SET_FIELD_CD_VALUE
    MLAD_SET_FIELD_VALUE_SUB --> |false| MLAD_SET_FIELD_STATE_SUB
    MLAD_SET_FIELD_STATE_SUB --> |true| MLAD_SET_FIELD_CD_STATE
    MLAD_SET_FIELD_STATE_SUB --> |false| RETURN
    MLAD_SET_VALUE --> RETURN
    MLAD_SET_STATE --> RETURN
    MLAD_SET_FIELD_CD_VALUE --> RETURN
    MLAD_SET_FIELD_CD_STATE --> RETURN
```

**Processing Flow Description:**

1. **Null Guard (early exit):** If either `key` or `subkey` is null, the method terminates immediately without any side effects. This is a defensive guard to prevent `NullPointerException` on downstream string comparisons.

2. **Unused separator calculation:** The method computes `key.indexOf("/")` into `separaterPoint` but never uses this value — likely legacy code carried over from a version that supported hierarchical key paths.

3. **Branch 1 — Send Destination Email Address (送信先メールアドレス):** When the key matches this literal string, the subkey determines the specific setter:
   - **subkey = "value"** (case-insensitive): Sets the actual email address value via `setMlad_value()`.
   - **subkey = "state"** (case-insensitive): Sets the field state via `setMlad_state()`.

4. **Branch 2 — Email Address Setting Field Code (メールアドレス設定フィールドコード):** When the key matches this second literal string, the subkey determines the specific setter:
   - **subkey = "value" (case-insensitive):** Sets the field code value via `setMlad_set_field_cd_value()`.
   - **subkey = "state" (case-insensitive):** Sets the field code state via `setMlad_set_field_cd_state()`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field name that identifies which logical model field to populate. Can take two values: `"送信先メールアドレス"` (Send Destination Email Address — the email address to which notifications are sent) or `"メールアドレス設定フィールドコード"` (Email Address Setting Field Code — the field code identifier for email address configuration). Determines which setter chain is invoked. |
| 2 | `subkey` | `String` | The sub-field discriminator within the key's scope. Determines whether the operation is a **value assignment** or a **state update**. Valid values: `"value"` (assign the data value) or `"state"` (set the field's display/validation state). Case-insensitive comparison. |
| 3 | `in_value` | `Object` | The data payload to store. Cast to `String` before passing to the setter. For `subkey = "value"`, this carries the actual business data (email address string or field code string). For `subkey = "state"`, this carries the state metadata (e.g., visibility, editability, required-flag). |
| 4 | `isSetAsString` | `boolean` | When `true`, indicates that a `Long`-type item's Value property should be set with a `String`-type value. In this method, the parameter is accepted but not actively used — it is a pass-through from overloaded delegating methods. It exists for API compatibility with other DBean implementations that perform type conversion. |

**Instance fields read:** None directly.

**Instance fields written (via setter calls):**
| Field | Setter Method | Data Type |
|-------|--------------|-----------|
| `mlad` (value) | `setMlad_value(String)` | String — email address data |
| `mlad` (state) | `setMlad_state(String)` | String — field state metadata |
| `mlad_set_field_cd` (value) | `setMlad_set_field_cd_value(String)` | String — field code data |
| `mlad_set_field_cd` (state) | `setMlad_set_field_cd_state(String)` | String — field code state metadata |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `setMlad_value` | `FUW00116SF01DBean` | - | Sets the send destination email address value in the bean's `mlad` field (in-memory model data update) |
| U | `setMlad_state` | `FUW00116SF01DBean` | - | Sets the send destination email address state in the bean's `mlad` field (in-memory metadata update) |
| U | `setMlad_set_field_cd_value` | `FUW00116SF01DBean` | - | Sets the email address setting field code value in the bean's `mlad_set_field_cd` field (in-memory model data update) |
| U | `setMlad_set_field_cd_state` | `FUW00116SF01DBean` | - | Sets the email address setting field code state in the bean's `mlad_set_field_cd` field (in-memory metadata update) |

All operations are **Update** (U) type — this method exclusively updates in-memory bean properties. It performs **no database CRUD**, no entity persistence, and no service component (SC) or business component (CBS) calls. It is a pure **view-to-model binding** operation.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `setMlad_set_field_cd_state` [-], `setMlad_set_field_cd_value` [-], `setMlad_state` [-], `setMlad_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | DBean: `FUW00116SF01DBean` (overloaded `storeModelData(gamenId, key, subkey, in_value)`) | `storeModelData(gamenId, key, subkey, in_value)` → `storeModelData(key, subkey, in_value)` → `storeModelData(key, subkey, in_value, false)` → `FUW00116SF01DBean.storeModelData(key, subkey, in_value, isSetAsString)` | `setMlad_value [U] -`, `setMlad_state [U] -`, `setMlad_set_field_cd_value [U] -`, `setMlad_set_field_cd_state [U] -` |
| 2 | DBean: `FUW00116SF01DBean` (overloaded `storeModelData(key, subkey, in_value)`) | `storeModelData(key, subkey, in_value)` → `storeModelData(key, subkey, in_value, false)` → `FUW00116SF01DBean.storeModelData(key, subkey, in_value, false)` | `setMlad_value [U] -`, `setMlad_state [U] -`, `setMlad_set_field_cd_value [U] -`, `setMlad_set_field_cd_state [U] -` |

The method is called exclusively by **delegating overload methods within the same class** (`FUW00116SF01DBean`), which progressively build the 4-argument signature. The broader call chain flows through the parent `FUW00116SFBean` class, which invokes `storeModelData` on `X33VDataTypeBeanInterface` instances held in list collections (e.g., `koumoku_code_list`, `bmp_list_list`) during bulk data population from the view layer. No direct screen (KKSV*) or batch entry points call this method — it operates as an internal binding helper within the DBean data flow.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L194)

> Null guard: if the field identifier (key) or sub-field discriminator (subkey) is null, abort processing. This prevents downstream `NullPointerException` on string comparisons and `indexOf()` calls.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(key == null || subkey == null)` // key, subkey are null — abort processing (key, subkey が null の場合、処理を中止) |
| 2 | RETURN | `return;` |

**Block 2** — [STATEMENT] (L199)

> Computes the position of the first "/" character in `key`. This variable is declared but never used in the method — likely legacy code from a version that supported hierarchical key paths (e.g., `"parent/child"`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // unused — legacy separator calculation |

**Block 3** — [IF-ELSE-IF] `(key equals "送信先メールアドレス")` (L202)

> Data type dispatch: Send Destination Email Address (送信先メールアドレス — Item ID: `mlad`). This field represents the email address to which system notifications are sent. The subkey determines whether to set the actual email address value or the field's display/validation state.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(key.equals("送信先メールアドレス"))` // Data type is String item "送信先メールアドレス" (item ID: `mlad`) |
| 2 | IF | — |

**Block 3.1** — [nested IF] `(subkey equalsIgnoreCase "value")` (L203)

> Sets the actual send destination email address value.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setMlad_value((String)in_value);` // Cast in_value to String and store as the email address value |

**Block 3.2** — [nested ELSE-IF] `(subkey equalsIgnoreCase "state")` (L205)

> Sets the field state metadata for the send destination email address. When the subkey is "state", it returns the state status.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setMlad_state((String)in_value);` // When subkey is "state", return the state (subkey が"state"の場合、ステータスを返す) |

**Block 4** — [ELSE-IF] `(key equals "メールアドレス設定フィールドコード")` (L210)

> Data type dispatch: Email Address Setting Field Code (メールアドレス設定フィールドコード — Item ID: `mlad_set_field_cd`). This field represents the configuration field code for email address settings. The subkey determines whether to set the field code value or its state metadata.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if(key.equals("メールアドレス設定フィールドコード"))` // Data type is String item "メールアドレス設定フィールドコード" (item ID: `mlad_set_field_cd`) |
| 2 | IF | — |

**Block 4.1** — [nested IF] `(subkey equalsIgnoreCase "value")` (L211)

> Sets the email address setting field code value.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setMlad_set_field_cd_value((String)in_value);` // Cast in_value to String and store as the field code value |

**Block 4.2** — [nested ELSE-IF] `(subkey equalsIgnoreCase "state")` (L214)

> Sets the field state metadata for the email address setting field code. When the subkey is "state", it returns the state status.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setMlad_set_field_cd_state((String)in_value);` // When subkey is "state", return the state (subkey が"state"の場合、ステータスを返す) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mlad` | Field | Mail List Array Data — in-memory bean field storing email address information. Item ID used as a subkey discriminator in the DBean's routing logic. |
| `mlad_set_field_cd` | Field | Mail List Array Data — Set Field Code — in-memory bean field storing the configuration field code for email address settings. Distinguished from `mlad` by the "field code" suffix. |
| `送信先メールアドレス` | Field | Send Destination Email Address — the email address to which system notifications and alerts are delivered. Corresponds to the `mlad` item ID. |
| `メールアドレス設定フィールドコード` | Field | Email Address Setting Field Code — the configuration identifier code that defines which UI field controls the email address input. Corresponds to the `mlad_set_field_cd` item ID. |
| `key` | Parameter | Field name — the logical identifier that selects which model field to populate. Acts as the primary dispatch key in the routing pattern. |
| `subkey` | Parameter | Sub-field discriminator — determines the operation type within the selected field: `"value"` for data assignment, `"state"` for metadata/state update. |
| `in_value` | Parameter | Input data — the payload object carrying the business data to be stored. Cast to `String` before assignment. |
| `isSetAsString` | Parameter | String-type flag — when true, indicates the value should be stored as a String even in a Long-typed property. Pass-through parameter not actively used in this implementation. |
| `separaterPoint` | Local Variable | Separator position — position index of "/" in the key string. Declared but unused; likely legacy from hierarchical key support. Note: field name contains intentional misspelling ("separater" instead of "separator") preserved from source. |
| `storeModelData` | Method | Store Model Data — the method's purpose as described in Javadoc. Populates the bean's internal model data from view-layer inputs. |
| DBean | Technical term | Data Bean — a view-layer data transfer component that holds screen-specific data. Part of the `eo.web.webview` package structure. `FUW00116SF01DBean` is the specific DBean for screen module `FUW00116SF`. |
| X33VDataTypeBeanInterface | Technical term | View data type bean interface — the common interface through which list elements delegate `storeModelData` calls. Used in parent class `FUW00116SFBean` for bulk data population. |
| `setMlad_value` | Method | Sets the send destination email address value in the bean's `mlad` field. |
| `setMlad_state` | Method | Sets the state metadata for the send destination email address in the bean's `mlad` field. |
| `setMlad_set_field_cd_value` | Method | Sets the email address setting field code value in the bean's `mlad_set_field_cd` field. |
| `setMlad_set_field_cd_state` | Method | Sets the state metadata for the email address setting field code in the bean's `mlad_set_field_cd` field. |
