# Business Logic — KKW22101SF02DBean.typeModelData() [91 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW22101SF.KKW22101SF02DBean` |
| Layer | Webview Bean / Data Type Bean (View layer — X33 framework data-binding support) |
| Module | `KKW22101SF` (Package: `eo.web.webview.KKW22101SF`) |

## 1. Role

### KKW22101SF02DBean.typeModelData()

This method implements the X33 framework's `X33VDataTypeBeanInterface.typeModelData()` contract, serving as the **data type router** for the `KKW22101SF02DBean` detail-line bean. It is invoked by the X33 view framework at runtime during screen rendering to determine the expected Java type for each field (subkey) of a home equipment provisioning service contract listing. The method accepts a business property name (`key`) and a sub-property name (`subkey`), then returns the corresponding `Class<?>` — typically `String.class` for display/edit values and `Boolean.class` for enabled/disabled state flags.

This is a shared utility pattern: the X33 framework calls `typeModelData()` whenever it needs to instantiate or bind data to the listed detail rows of the "Equipment Provisioning Service Contract Detail List" screen (`機器提供サービス契約一覧明细リスト`, item ID: `service_list`). Each property in this bean (e.g., home equipment model code, home equipment model name, equipment assignment billing start date, etc.) exposes three standard sub-properties: `value` (the data value), `enable` (whether the field is editable), and `state` (the display/validity state). The method routes all six home equipment properties through a uniform branch structure, mapping `value` and `state` to `String.class` and `enable` to `Boolean.class`. It implements a routing/dispatch design pattern with no CRUD side effects — purely a type introspection utility.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    CHECK_NULL{key or subkey is null}
    RETURN_NULL(["return null"])
    FIND_SLASH["Find slash index in key"]

    SUB_1{"key equals home_equipment_model_code"}
    S1_V{subkey is value}
    S1_E{subkey is enable}
    S1_S{subkey is state}
    RET_1V["return String.class"]
    RET_1E["return Boolean.class"]
    RET_1S["return String.class"]

    SUB_2{"key equals home_equipment_model_name"}
    S2_V{subkey is value}
    S2_E{subkey is enable}
    S2_S{subkey is state}
    RET_2V["return String.class"]
    RET_2E["return Boolean.class"]
    RET_2S["return String.class"]

    SUB_3{"key equals equipment_billing_start_date"}
    S3_V{subkey is value}
    S3_E{subkey is enable}
    S3_S{subkey is state}
    RET_3V["return String.class"]
    RET_3E["return Boolean.class"]
    RET_3S["return String.class"]

    SUB_4{"key equals equipment_plan_start_date"}
    S4_V{subkey is value}
    S4_E{subkey is enable}
    S4_S{subkey is state}
    RET_4V["return String.class"]
    RET_4E["return Boolean.class"]
    RET_4S["return String.class"]

    SUB_5{"key equals equipment_service_name"}
    S5_V{subkey is value}
    S5_E{subkey is enable}
    S5_S{subkey is state}
    RET_5V["return String.class"]
    RET_5E["return Boolean.class"]
    RET_5S["return String.class"]

    SUB_6{"key equals smart_link_premium_pack"}
    S6_V{subkey is value}
    S6_E{subkey is enable}
    S6_S{subkey is state}
    RET_6V["return String.class"]
    RET_6E["return Boolean.class"]
    RET_6S["return String.class"]

    NO_MATCH(["No matching property found"])
    RETURN_END(["return null"])

    START --> CHECK_NULL
    CHECK_NULL -- Yes --> RETURN_NULL
    CHECK_NULL -- No --> FIND_SLASH
    FIND_SLASH --> SUB_1
    SUB_1 -- Yes --> S1_V
    SUB_1 -- No --> SUB_2
    SUB_2 -- Yes --> S2_V
    SUB_2 -- No --> SUB_3
    SUB_3 -- Yes --> S3_V
    SUB_3 -- No --> SUB_4
    SUB_4 -- Yes --> S4_V
    SUB_4 -- No --> SUB_5
    SUB_5 -- Yes --> S5_V
    SUB_5 -- No --> SUB_6
    SUB_6 -- Yes --> S6_V
    SUB_6 -- No --> NO_MATCH
    S1_V -- Yes --> RET_1V
    S1_V -- No --> S1_E
    S1_E -- Yes --> RET_1E
    S1_E -- No --> S1_S
    S1_S -- Yes --> RET_1S
    S1_S -- No --> NO_MATCH
    RET_1V --> RETURN_END
    RET_1E --> RETURN_END
    RET_1S --> RETURN_END
    S2_V -- Yes --> RET_2V
    S2_V -- No --> S2_E
    S2_E -- Yes --> RET_2E
    S2_E -- No --> S2_S
    S2_S -- Yes --> RET_2S
    S2_S -- No --> NO_MATCH
    RET_2V --> RETURN_END
    RET_2E --> RETURN_END
    RET_2S --> RETURN_END
    S3_V -- Yes --> RET_3V
    S3_V -- No --> S3_E
    S3_E -- Yes --> RET_3E
    S3_E -- No --> S3_S
    S3_S -- Yes --> RET_3S
    S3_S -- No --> NO_MATCH
    RET_3V --> RETURN_END
    RET_3E --> RETURN_END
    RET_3S --> RETURN_END
    S4_V -- Yes --> RET_4V
    S4_V -- No --> S4_E
    S4_E -- Yes --> RET_4E
    S4_E -- No --> S4_S
    S4_S -- Yes --> RET_4S
    S4_S -- No --> NO_MATCH
    RET_4V --> RETURN_END
    RET_4E --> RETURN_END
    RET_4S --> RETURN_END
    S5_V -- Yes --> RET_5V
    S5_V -- No --> S5_E
    S5_E -- Yes --> RET_5E
    S5_E -- No --> S5_S
    S5_S -- Yes --> RET_5S
    S5_S -- No --> NO_MATCH
    RET_5V --> RETURN_END
    RET_5E --> RETURN_END
    RET_5S --> RETURN_END
    S6_V -- Yes --> RET_6V
    S6_V -- No --> S6_E
    S6_E -- Yes --> RET_6E
    S6_E -- No --> S6_S
    S6_S -- Yes --> RET_6S
    S6_S -- No --> NO_MATCH
    RET_6V --> RETURN_END
    RET_6E --> RETURN_END
    RET_6S --> RETURN_END
```

**Processing flow summary:**

1. **Null guard** (L525): If `key` or `subkey` is `null`, return `null` immediately.
2. **Slash detection** (L528): Compute `separaterPoint` via `key.indexOf("/")`. This value is computed but never used in this method — likely a leftover from a previous implementation or reserved for future use.
3. **Six property branches** (L531–L608): Each `if/else-if` block matches a specific Japanese property name (`key`) and dispatches on the `subkey` case-insensitively:
   - **`value`** (case-insensitive match) -> returns `String.class` — the actual data value.
   - **`enable`** (case-insensitive match) -> returns `Boolean.class` — whether the UI field is enabled for editing.
   - **`state`** (case-insensitive match) -> returns `String.class` — the display/validation state of the field.
4. **Fallback** (L611): If no property name matches, return `null`.

**Branch descriptions:**

| Branch | Japanese Key | English Business Meaning | Item ID (Field) |
|--------|-------------|-------------------------|-----------------|
| 1 | `宅内機器型式コード` | Home Equipment Model Code | `taknkiki_model_cd` |
| 2 | `宅内機器型式名` | Home Equipment Model Name | `taknkiki_model_nm` |
| 3 | `機器割当請求開始年月` | Equipment Assignment Billing Start Date | `kiki_kap_seiky_sta_ym` |
| 4 | `機器プラン開始年月日` | Equipment Plan Start Date | `kiki_pplan_sta_ym` |
| 5 | `機器提供サービス名` | Equipment Provisioning Service Name | `kiki_tk_svs_mei` |
| 6 | `スマートリンクプレミアムパック有無` | Smart Link Premium Pack Availability | `smartrink_premium_um` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business property name (item label) identifying which home equipment field to resolve. Accepts Japanese display names such as "宅内機器型式コード" (Home Equipment Model Code) or "機器割当請求開始年月" (Equipment Assignment Billing Start Date). Determines which of the 6 property branches is entered. If the value does not match any known property name, the method falls through to return `null`. |
| 2 | `subkey` | `String` | The sub-property identifier within a field, case-insensitive. Determines what metadata to return about the field: `value` (the actual data value type), `enable` (the editability flag type), or `state` (the display state type). Any unrecognized subkey returns `null`. |

**No instance fields or external state are read** by this method. It is fully stateless — all data comes from the two parameters.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations**. It is a pure type-introspection utility that returns `Class<?>` values without any database access, service calls, or side effects. No methods are called beyond `String.indexOf()` and `String.equalsIgnoreCase()`.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| (none) | — | — | — | This method is a pure read-only type router with no database or service interactions. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW22101SF (KKW22101SFBean) | `KKW22101SFBean.typeModelData(String key, String subkey)` -> `KKW22101SF02DBean.typeModelData(String key, String subkey)` | N/A (pure type resolver) |

**Caller details:**

- **KKW22101SFBean.java** (L4178–L4185): The parent bean's `typeModelData` method has a special case for the key `"機器提供サービス契約一覧明细リスト"` (Equipment Provisioning Service Contract Detail List). When this key is passed, the X33 framework delegates to `KKW22101SF02DBean.typeModelData()` to resolve data types for each property within the listed detail rows.
- The method is called **indirectly** by the X33 framework's data-binding layer during screen rendering. The framework iterates over the listed items of `service_list` and calls `typeModelData(key, subkey)` on each `KKW22101SF02DBean` instance to determine the type of each field (value, enable, state).

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L524-526)

> Null guard: return `null` if either parameter is missing. This prevents `NullPointerException` on subsequent string operations.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` |
| 2 | RETURN | `return null;` // key or subkey is null |

**Block 2** — [EXEC] (L528)

> Computes the position of "/" in the key string. This value is stored but never used in this method — reserved for future functionality or left over from a previous implementation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` // Find slash position in key |

**Block 3** — [IF] `key.equals("宅内機器型式コード")` (Home Equipment Model Code) (L531-543)

> Route for the home equipment model code field. Each subkey maps to a standard data type: `value` and `state` return `String.class`, `enable` returns `Boolean.class`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("宅内機器型式コード"))` // "Home Equipment Model Code" |
| 2 | BLOCK 3.1 | See Block 3.1 below |

**Block 3.1** — [nested IF-ELSE-IF] `(subkey.equalsIgnoreCase("value" | "enable" | "state"))` (L532-543)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` // Case-insensitive match for "value" |
| 2 | RETURN | `return String.class;` // The data value is a String |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` // Case-insensitive match for "enable" |
| 4 | RETURN | `return Boolean.class;` // The editability flag is a Boolean |
| 5 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` // Case-insensitive match for "state" |
| 6 | RETURN | `return String.class;` // The display state is a String // subkeyが"state"の場合、ステータスを返す |

**Block 4** — [ELSE-IF] `key.equals("宅内機器型式名")` (Home Equipment Model Name) (L547-559)

> Route for the home equipment model name field. Same subkey mapping as Block 3.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("宅内機器型式名"))` // "Home Equipment Model Name" |
| 2 | BLOCK 4.1 | See Block 4.1 below |

**Block 4.1** — [nested IF-ELSE-IF] `(subkey.equalsIgnoreCase("value" | "enable" | "state"))` (L548-559)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 6 | RETURN | `return String.class;` |

**Block 5** — [ELSE-IF] `key.equals("機器割当請求開始年月")` (Equipment Assignment Billing Start Date) (L563-575)

> Route for the equipment assignment billing start date/year-month field.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("機器割当請求開始年月"))` // "Equipment Assignment Billing Start Date" |
| 2 | BLOCK 5.1 | Same subkey pattern as above |

**Block 5.1** — [nested IF-ELSE-IF] (L564-575)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 6 | RETURN | `return String.class;` |

**Block 6** — [ELSE-IF] `key.equals("機器プラン開始年月日")` (Equipment Plan Start Date) (L579-591)

> Route for the equipment plan start date/year-month-day field.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("機器プラン開始年月日"))` // "Equipment Plan Start Date" |
| 2 | BLOCK 6.1 | Same subkey pattern as above |

**Block 6.1** — [nested IF-ELSE-IF] (L580-591)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 6 | RETURN | `return String.class;` |

**Block 7** — [ELSE-IF] `key.equals("機器提供サービス名")` (Equipment Provisioning Service Name) (L595-607)

> Route for the equipment provisioning service name field.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("機器提供サービス名"))` // "Equipment Provisioning Service Name" |
| 2 | BLOCK 7.1 | Same subkey pattern as above |

**Block 7.1** — [nested IF-ELSE-IF] (L596-607)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 6 | RETURN | `return String.class;` |

**Block 8** — [ELSE-IF] `key.equals("スマートリンクプレミアムパック有無")` (Smart Link Premium Pack Availability) (L611-623)

> Route for the Smart Link Premium Pack availability indicator field.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("スマートリンクプレミアムパック有無"))` // "Smart Link Premium Pack Availability" |
| 2 | BLOCK 8.1 | Same subkey pattern as above |

**Block 8.1** — [nested IF-ELSE-IF] (L612-623)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 6 | RETURN | `return String.class;` |

**Block 9** — [ELSE/FALLBACK] (L628)

> No matching property name found. Return `null` to signal that the key is not recognized. The X33 framework will handle `null` as an unrecognized property.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // 条件に一致するプロパティが存在しない場合は、nullを返す |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `taknkiki_model_cd` | Field | Home Equipment Model Code — the model code identifier for customer premises equipment (e.g., ONT/router models) |
| `taknkiki_model_nm` | Field | Home Equipment Model Name — human-readable name of the customer premises equipment model |
| `kiki_kap_seiky_sta_ym` | Field | Equipment Assignment Billing Start Year-Month — the year and month when billing starts for assigned equipment |
| `kiki_pplan_sta_ym` | Field | Equipment Plan Start Year-Month-Day — the start date of the equipment plan |
| `kiki_tk_svs_mei` | Field | Equipment Provisioning Service Name — the name of the service provided using the equipment |
| `smartrink_premium_um` | Field | Smart Link Premium Pack Availability — indicates whether the Smart Link Premium Pack add-on service is active (有無 = presence/absence) |
| `service_list` | Field ID | Equipment Provisioning Service Contract Detail List — the X33 item ID for the repeated detail line list in the KKW22101SF screen |
| X33 | Acronym | Fujitsu Futurity X33 — an enterprise web application framework used by K-Opticom for building web client screens |
| `X33VDataTypeBeanInterface` | Interface | X33 framework interface for beans that support data type introspection (resolving field types dynamically) |
| `X33VListedBeanInterface` | Interface | X33 framework interface for beans that support repeated list/detail line data |
| KKW22101SF | Screen Module | K-Opticom screen module for equipment provisioning service contract management (home equipment setup) |
| KKW22101SF02DBean | Bean | Detail-line data bean for the equipment provisioning service contract listing screen; defines properties for home equipment type, name, billing start date, plan start date, service name, and Smart Link Premium Pack |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service provided by K-Opticom |
| `value` | Subkey | The data value property of a field — the actual data to display or edit |
| `enable` | Subkey | The editability flag property of a field — `true` means the field is enabled for user input |
| `state` | Subkey | The display state property of a field — string-based status indicating validity or display condition |
