only:reducing confusion
This commit is contained in:
parent
b985d28df2
commit
75f457ad53
|
@ -16,4 +16,10 @@ public class EnumPair {
|
|||
public String getArrayForm() {
|
||||
return arrayForm;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
if (arrayForm.isEmpty() ^ keyValueForm.isEmpty())
|
||||
throw new IllegalStateException("Expecting either both empty or both not empty [" + arrayForm + "][" + keyValueForm + "]");
|
||||
return arrayForm.isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class PinoutLogic {
|
|||
String nothingName = namePinType.getNothingName();
|
||||
EnumsReader.EnumState enumList = enumsReader.getEnums().get(pinType);
|
||||
EnumPair pair = enumToOptionsList(nothingName, enumList, kv.getValue());
|
||||
if (pair.getArrayForm().length() > 0) {
|
||||
if (!pair.isEmpty()) {
|
||||
// we seem to be here if specific pin category like switch_inputs has no pins
|
||||
parseState.addDefinition(registry, outputEnumName + KEY_VALUE_FORMAT_ENUM, pair.getKeyValueForm(), Definition.OverwritePolicy.IgnoreNew);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue