private AbstractAddMemoryBlockCmd createNonMappedMemoryBlock(String source) {
		switch (initializedType) {
			case INITIALIZED_FROM_FILE_BYTES:
				return new AddFileBytesMemoryBlockCmd(blockName, comment, source, startAddr, length,
					isRead, isWrite, isExecute, isVolatile, fileBytes, fileBytesOffset, isOverlay);
			case INITIALIZED_FROM_VALUE:
				return new AddInitializedMemoryBlockCmd(blockName, comment, source, startAddr,
					length, isRead, isWrite, isExecute, isVolatile, (byte) initialValue, isOverlay);
			case UNINITIALIZED:
				return new AddUninitializedMemoryBlockCmd(blockName, comment, source, startAddr,
					length, isRead, isWrite, isExecute, isVolatile, isOverlay);
			default:
				throw new AssertException(
					"Encountered unexpected intialized type: " + initializedType);

		}
	}
Model to manage adding a memory block.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockModel.java