/*
 * Copyright 2021 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.core.codesystem;

import java.io.Serializable;
import java.util.List;

import com.b2international.index.revision.RevisionBranch.BranchState;
import com.b2international.snowowl.core.branch.BranchInfo;
import com.b2international.snowowl.core.uri.CodeSystemURI;

/**
 * @since 7.17.0
 */
public final class UpgradeInfo implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	BranchInfo mainBranchInfo;
	List<BranchInfo> versionBranchInfos;
	List<CodeSystemURI> blockedURIs;
	
	public UpgradeInfo(BranchInfo mainBranchInfo, List<BranchInfo> versionBranchInfos, List<CodeSystemURI> blockedURIs) {
		this.mainBranchInfo = mainBranchInfo;
		this.versionBranchInfos = versionBranchInfos;
		this.blockedURIs = blockedURIs;
	}
	
	public BranchInfo getMainBranchInfo() {
		return mainBranchInfo;
	}
	
	public List<BranchInfo> getVersionBranchInfos() {
		return versionBranchInfos;
	}
	
	public List<CodeSystemURI> getBlockedURIs() {
		return blockedURIs;
	}
	
	public boolean isBlocked() {
		return mainBranchInfo.getState()  == BranchState.DIVERGED || mainBranchInfo.getState()  == BranchState.BEHIND;
	}
	
}

@@ -1052,36 +1052,41 @@
 ;%0A%09%0A%09BranchInfo 
-main
+upgradeOf
 BranchInfo;%0A%09Lis
@@ -1281,20 +1281,25 @@
 %0A%09%09this.
-main
+upgradeOf
 BranchIn
@@ -1398,32 +1398,95 @@
 ockedURIs;%0A%09%7D%0A%09%0A
+%09// returns the BranchInfo of the upgradeOf Code System's HEAD%0A
 %09public BranchIn
@@ -1495,12 +1495,17 @@
  get
-Main
+UpgradeOf
 Bran
@@ -1516,36 +1516,41 @@
 fo() %7B%0A%09%09return 
-main
+upgradeOf
 BranchInfo;%0A%09%7D%0A%09
@@ -1748,20 +1748,25 @@
 %09return 
-main
+upgradeOf
 BranchIn
@@ -1807,20 +1807,25 @@
 RGED %7C%7C 
-main
+upgradeOf
 BranchIn

rename field and getter