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

Method getKeyFor

code/src/java/pcgen/io/Compatibility.java:78–104  ·  view source on GitHub ↗
(PCTemplate pct)

Source from the content-addressed store, hash-verified

76 }
77
78 @NotNull
79 public static String getKeyFor(PCTemplate pct)
80 {
81 Integer level = pct.get(IntegerKey.LEVEL);
82 StringBuilder hd = new StringBuilder();
83 if (level == null)
84 {
85 hd.append('H');
86 Integer min = pct.get(IntegerKey.HD_MIN);
87 Integer max = pct.get(IntegerKey.HD_MAX);
88 hd.append(min);
89 if (max == Integer.MAX_VALUE)
90 {
91 hd.append('+');
92 }
93 else if (!max.equals(min))
94 {
95 hd.append('-').append(max);
96 }
97 }
98 else
99 {
100 hd.append('L');
101 hd.append(level);
102 }
103 return hd.toString();
104 }
105
106 @Nullable
107 public static PersistentTransitionChoice<?> processOldAdd(LoadContext context, String first)

Callers 1

writeTemplateFeatMethod · 0.95

Calls 4

getMethod · 0.65
equalsMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected