void (String filePath) { String filePathBefore = getMyFilePath(); this.update( () -> myFilePath = filePath, (builder, entity) -> { if (filePathBefore.equals(filePath)) return; builder.modifyEntity(FileOrDirectoryPackagingElementEntity.Builder.class, entity, ent -> { VirtualFileUrlManager manager = VirtualFileUrls.getVirtualFileUrlManager(myProject); if (filePath != null) { VirtualFileUrl fileUrl = manager.fromPath(filePath); ent.setFilePath(fileUrl); } else { ent.setFilePath(null); } return Unit.INSTANCE; }); }); }