---

# Business Logic — Predicater.evaluate() [11 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.Predicater` |
| Layer | CC/Common Component (Inner class within `JKKWribSvcKeiOperateCC`) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### Predicater.evaluate()

The `evaluate` method is the core predicate evaluation function implemented by the `ListMultiFilter` class, which implements the `Predicater` functional interface. Its business purpose is to perform a multi-value membership check: given a `HashMap<String, String>` representing a set of key-value pairs (typically a row of screen-bound data), it determines whether the value associated with a specific key matches **any** entry in a predefined set of acceptable values. This method implements the **Predicate design pattern**, acting as a reusable filter criterion that can be composed with higher-order filtering operations. It serves as the shared utility predicate used by the `Items` utility class methods (`exist`, `find`, `select`) and the `JFUXPathManager` methods (`getItem`, `getItemAsNodeList`, `isElement`) to determine whether individual data items satisfy a given condition — for example, matching a service type code against a list of valid codes, or confirming that a status field contains an expected value. The method supports the telecom service contract management domain, where data items carry coded fields (e.g., service type, network type, installation status) that must be validated against approved value sets.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["evaluate(item)"])
    GET_VALUE["itemValue = item.get(key)"]
    LOOP_START["For each Object value in values[]"]
    COMPARE["value.equals(itemValue)"]
    MATCH["Return true"]
    NO_MATCH["No match found"]
    RETURN_FALSE["Return false"]
    END_NODE(["Return / Next"])

    START --> GET_VALUE
    GET_VALUE --> LOOP_START
    LOOP_START --> COMPARE
    COMPARE --> |true| MATCH
    COMPARE --> |false| LOOP_START
    LOOP_START --> |loop ends| NO_MATCH
    NO_MATCH --> RETURN_FALSE
```

This method performs a simple multi-value membership test with the following steps:

1. **Retrieve the target value** from the input map using the pre-configured `key` field.
2. **Iterate through the allowed values** stored in the `values` array.
3. **Compare each allowed value** against the retrieved item value using `Object.equals()`.
4. **Return `true`** as soon as a match is found (short-circuit).
5. **Return `false`** if no match is found after exhausting the entire array.

The method is generic in its interface — the `key` and `values` are configured at construction time by the `ListMultiFilter` constructor, allowing callers to define arbitrary key-value membership predicates.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `item` | `HashMap<String, String>` | A map representing a single data record or entity instance from the telecom service order management system. Each key-value pair corresponds to a field in the record (e.g., service type code, installation status, network medium). The map is produced by screen data binding (BeanMap) and passed through the Items filtering pipeline. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `key` | `String` | The map key (field name) to look up in `item`. Set at construction time by `ListMultiFilter` (e.g., `"svc_kei_cd"` for service type code). |
| `values` | `Object[]` | An array of acceptable values for the specified key. Set at construction time. Contains domain-coded strings such as `"01"` (FTTH), `"02"` (Mail), `"03"` (Phone Pack), etc. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatFUCaseFileRnkData.getString` | JBSbatFUCaseFileRnkData | - | Calls `getString` in `JBSbatFUCaseFileRnkData` |
| R | `JBSbatFUMoveNaviData.getString` | JBSbatFUMoveNaviData | - | Calls `getString` in `JBSbatFUMoveNaviData` |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Calls `getString` in `JBSbatZMAdDataSet` |
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` |
| - | `Items.exist` | Items | - | Calls `exist` in `Items` |
| - | `SvcKeiFinderWithTrgtSvc.isAllEmptyTarget` | SvcKeiFinderWithTrgtSvc | - | Calls `isAllEmptyTarget` in `SvcKeiFinderWithTrgtSvc` |
| - | `SvcKeiFinderWithTrgtSvc.isCollect` | SvcKeiFinderWithTrgtSvc | - | Calls `isCollect` in `SvcKeiFinderWithTrgtSvc` |
| - | `JKKWribSvcKeiOperateCC.resolveDchsCdHeiyo` | JKKWribSvcKeiOperateCC | - | Calls `resolveDchsCdHeiyo` in `JKKWribSvcKeiOperateCC` |
| - | `JKKWribSvcKeiOperateCC.resolveWribSvcCdHeiyo` | JKKWribSvcKeiOperateCC | - | Calls `resolveWribSvcCdHeiyo` in `JKKWribSvcKeiOperateCC` |
| - | `JPCDateUtil.subtractDay` | JPCDate | - | Calls `subtractDay` in `JPCDateUtil` |
| - | `JPCUtilCommon.subtractDay` | JPCUtilCommon | - | Calls `subtractDay` in `JPCUtilCommon` |
| R | `JESC0101B010TPMA.getString` | JESC0101B010TPMA | - | Calls `getString` in `JESC0101B010TPMA` |
| R | `JESC0101B020TPMA.getString` | JESC0101B020TPMA | - | Calls `getString` in `JESC0101B020TPMA` |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` |

**No direct CRUD, SC, or DB operations are performed by this method.** It operates entirely in-memory, performing a value membership check on data already loaded into the system. The only external method calls are `HashMap.get()` (on the input parameter) and `Object.equals()` (for comparison).

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 131 methods.
Terminal operations from this method: `isAllEmptyTarget` [-], `isAllEmptyTarget` [-], `isCollect` [-], `isCollect` [-], `isCollect` [-], `isCollect` [-], `isCollect` [-], `isCollect` [-], `isCollect` [-], `isCollect` [-], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `Items.exist()` | `Items.exist(in, predicater)` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |
| 2 | `Items.find()` | `Items.find(in, predicater)` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |
| 3 | `Items.select()` | `Items.select(in, predicater)` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |
| 4 | `JFUMailSupportInterface.communication()` | `JFUMailSupportInterface.communication()` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |
| 5 | `JFUXPathManager.getItem()` | `JFUXPathManager.getItem()` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |
| 6 | `JFUXPathManager.getItemAsNodeList()` | `JFUXPathManager.getItemAsNodeList()` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |
| 7 | `JFUXPathManager.isElement()` | `JFUXPathManager.isElement()` -> `predicater.evaluate(item)` | HashMap.get[R] (in-memory) |

This method is called exclusively through the `Predicater` interface by utility methods in the `Items` class and `JFUXPathManager`. It does not invoke any downstream services, database queries, or CBS (CBS = Central Business System) components. All terminal operations resolve to in-memory HashMap lookups.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] Retrieve value from map `(item.get(key))` (L17413)

> Retrieves the value associated with the configured `key` from the input `item` map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `Object itemValue = item.get(key);` // Get the value for the predicate key from the input map [-> key = configured field name] |

**Block 2** — [FOR] Iterate over allowed values `(for (Object value : values))` (L17415)

> Loops through each value in the predefined `values` array to check for a match.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (Object value : values)` // Iterate over each allowed value in the predefined array [-> values = configured acceptable values] |

**Block 2.1** — [IF] Compare value `(value.equals(itemValue))` (L17416)

> Checks if the current allowed value matches the item's retrieved value.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (value.equals(itemValue))` // Compare allowed value against retrieved map value |

**Block 2.1.1** — [RETURN] Match found `(true)` (L17417)

> Returns `true` immediately when a match is found (short-circuit evaluation).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true;` // Value found in allowed set — predicate satisfied |

**Block 2.2** — [ELSE] No match in loop

> If no value in the array matches after the loop completes.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return false;` // No match found — predicate not satisfied |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| Predicater | Interface | A functional interface defining a single `evaluate(I)` method that returns a boolean. Implements the classic GoF **Predicate** pattern — a reusable condition that evaluates whether an item satisfies a criterion. |
| ListMultiFilter | Class | A concrete implementation of `Predicater<HashMap<String, String>>` that checks whether a map value matches any entry in a predefined set of allowed values. |
| key | Field | The map key (field name) to look up in the input `item`. Configurable per `ListMultiFilter` instance. |
| values | Field | An array of acceptable values for the configured key. Configurable per instance. |
| item | Parameter | A `HashMap<String, String>` representing a single data record (e.g., service order line item) with field names as keys and field values as values. |
| Items | Class | A utility class providing higher-order collection operations (`exist`, `find`, `select`, `map`, `each`) that accept `Predicater` instances for filtering and transforming lists of data items. |
| HashMap | Java class | A hash-based map data structure used throughout the application to represent data records as key-value pairs. |
| Service Contract Management | Domain | The telecom business domain this system operates in — managing service contracts, order fulfillment, equipment installation, and plan changes for NTT东日本 (NTT East) cable services. |
| BeanMap | Domain concept | A data structure mapping JavaBean property names to their values, used for screen data binding. The `HashMap<String, String>` input to `evaluate` is typically a BeanMap representation of a screen row. |

---
