MCPcopy Create free account
hub / github.com/PCGen/pcgen / unparse

Method unparse

code/src/java/plugin/lsttokens/spell/SchoolToken.java:87–105  ·  view source on GitHub ↗
(LoadContext context, Spell spell)

Source from the content-addressed store, hash-verified

85 }
86
87 @Override
88 public String[] unparse(LoadContext context, Spell spell)
89 {
90 Changes<SpellSchool> changes = context.getObjectContext().getListChanges(spell, ListKey.SPELL_SCHOOL);
91 if (changes == null || changes.isEmpty())
92 {
93 return null;
94 }
95 StringJoiner joiner = new StringJoiner(Constants.PIPE);
96 if (changes.includesGlobalClear())
97 {
98 joiner.add(Constants.LST_DOT_CLEAR);
99 }
100 if (changes.hasAddedItems())
101 {
102 changes.getAdded().forEach(added -> joiner.add(added.toString()));
103 }
104 return new String[]{joiner.toString()};
105 }
106
107 @Override
108 public Class<Spell> getTokenClass()

Callers

nothing calls this directly

Calls 9

forEachMethod · 0.80
getListChangesMethod · 0.65
getObjectContextMethod · 0.65
isEmptyMethod · 0.65
includesGlobalClearMethod · 0.65
addMethod · 0.65
hasAddedItemsMethod · 0.65
getAddedMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected