@Override
	public void add(String valueName, long value, String comment) {
		lock.acquire();
		try {
			checkDeleted();
			initializeIfNeeded();
			checkValue(value);
			if (nameMap.containsKey(valueName)) {
				throw new IllegalArgumentException(valueName + " already exists in this enum");
			}

			if (StringUtils.isBlank(comment)) {
				comment = null; // use null values in the db to save space
			}

			bitGroups = null;
			valueAdapter.createRecord(key, valueName, value, comment);
			adapter.updateRecord(record, true);
			addToCache(valueName, value, comment);
			signedState = computeSignedness();
			dataMgr.dataTypeChanged(this, false);
		}
		catch (IOException e) {
			dataMgr.dbError(e);
		}
		finally {
			lock.release();
		}
	}
Database implementation for the enumerated data type.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/EnumDB.java