(LoadContext context, Ability ability)
| 115 | } |
| 116 | |
| 117 | @Override |
| 118 | public String[] unparse(LoadContext context, Ability ability) |
| 119 | { |
| 120 | PatternChanges<Description> changes = |
| 121 | context.getObjectContext().getListPatternChanges(ability, ListKey.BENEFIT); |
| 122 | if (changes == null || changes.isEmpty()) |
| 123 | { |
| 124 | return null; |
| 125 | } |
| 126 | List<String> list = new ArrayList<>(); |
| 127 | Collection<String> removedItems = changes.getRemoved(); |
| 128 | if (changes.includesGlobalClear()) |
| 129 | { |
| 130 | if (removedItems != null && !removedItems.isEmpty()) |
| 131 | { |
| 132 | context.addWriteMessage( |
| 133 | "Non-sensical relationship in " + getTokenName() + ": global .CLEAR and local .CLEAR. performed"); |
| 134 | return null; |
| 135 | } |
| 136 | list.add(Constants.LST_DOT_CLEAR); |
| 137 | } |
| 138 | else if (removedItems != null && !removedItems.isEmpty()) |
| 139 | { |
| 140 | for (String d : removedItems) |
| 141 | { |
| 142 | list.add(Constants.LST_DOT_CLEAR_DOT + d); |
| 143 | } |
| 144 | } |
| 145 | Collection<Description> added = changes.getAdded(); |
| 146 | if (added != null && !added.isEmpty()) |
| 147 | { |
| 148 | for (Description d : added) |
| 149 | { |
| 150 | list.add(d.getPCCText()); |
| 151 | } |
| 152 | } |
| 153 | if (list.isEmpty()) |
| 154 | { |
| 155 | return null; |
| 156 | } |
| 157 | return list.toArray(new String[0]); |
| 158 | } |
| 159 | |
| 160 | @Override |
| 161 | public Class<Ability> getTokenClass() |
nothing calls this directly
no test coverage detected