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

Method getNameFromModifiers

code/src/java/pcgen/core/Equipment.java:3900–3920  ·  view source on GitHub ↗

Gets the nameFromModifiers attribute of the Equipment object @param eqModList The list of modifiers @return The nameFromModifiers value

(final List<EquipmentModifier> eqModList)

Source from the content-addressed store, hash-verified

3898 * @return The nameFromModifiers value
3899 */
3900 private String getNameFromModifiers(final List<EquipmentModifier> eqModList)
3901 {
3902 //
3903 // Get a sorted list so that the description will always come
3904 // out the same reguardless of the order we've added the modifiers
3905 //
3906 final List<EquipmentModifier> eqList = new ArrayList<>(eqModList);
3907 Globals.sortPObjectList(eqList);
3908
3909 final StringBuilder sMod = new StringBuilder(70);
3910
3911 eqList.stream().map(eqMod -> eqMod.getSafe(ObjectKey.NAME_OPT).returnName(this, eqMod)).forEach(modDesc -> {
3912 if (sMod.length() > 0 && !modDesc.isEmpty())
3913 {
3914 sMod.append('/');
3915 }
3916 sMod.append(modDesc);
3917 });
3918
3919 return sMod.toString();
3920 }
3921
3922 /**
3923 * Gets the specialAbilityList attribute of the Equipment object

Callers 1

buildEqModDescMethod · 0.95

Calls 8

sortPObjectListMethod · 0.95
forEachMethod · 0.80
streamMethod · 0.80
returnNameMethod · 0.80
getSafeMethod · 0.80
isEmptyMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected