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

Method unparse

code/src/java/plugin/lsttokens/KitLst.java:131–150  ·  view source on GitHub ↗
(LoadContext context, CDOMObject pcc)

Source from the content-addressed store, hash-verified

129 }
130
131 @Override
132 public String[] unparse(LoadContext context, CDOMObject pcc)
133 {
134 Changes<TransitionChoice<Kit>> changes = context.getObjectContext().getListChanges(pcc, ListKey.KIT_CHOICE);
135 if (changes == null || changes.isEmpty())
136 {
137 // Zero indicates no Token
138 return null;
139 }
140 Collection<TransitionChoice<Kit>> added = changes.getAdded();
141 Set<String> set = new TreeSet<>();
142 for (TransitionChoice<Kit> tc : added)
143 {
144 String sb = tc.getCount()
145 + Constants.PIPE
146 + tc.getChoices().getLSTformat().replaceAll(Constants.COMMA, Constants.PIPE);
147 set.add(sb);
148 }
149 return set.toArray(new String[0]);
150 }
151
152 @Override
153 public Class<CDOMObject> getTokenClass()

Callers

nothing calls this directly

Calls 10

getListChangesMethod · 0.65
getObjectContextMethod · 0.65
isEmptyMethod · 0.65
getAddedMethod · 0.65
getCountMethod · 0.65
getLSTformatMethod · 0.65
getChoicesMethod · 0.65
addMethod · 0.65
replaceAllMethod · 0.45
toArrayMethod · 0.45

Tested by

no test coverage detected