/**
 * 
 */
package eu.dnetlib.pid.service;

import java.util.Map;

import com.google.common.collect.Maps;

/**
 * @author alessia
 * 
 */
public class PIDAssignmentRule {

	private String baseNodesXPath, localIDXPath, resolveURLXPath, targetXPath;
	/**
	 * Keys are the view of the location, such as: master, derivative2, derivtaive3
	 */
	private Map<String, PIDLocAttRule> locattRules = Maps.newHashMap();

	public boolean hasResolveURLXPath() {
		return this.getResolveURLXPath() != null && !this.getResolveURLXPath().isEmpty();
	}

	public boolean hasLocattRules() {
		return this.getLocattRules() != null && !this.getLocattRules().isEmpty();
	}

	public Map<String, PIDLocAttRule> getLocattRules() {
		return locattRules;
	}

	public void setLocattRules(Map<String, PIDLocAttRule> locattRules) {
		this.locattRules = locattRules;
	}

	public String getLocalIDXPath() {
		return localIDXPath;
	}

	public void setLocalIDXPath(String localIDXPath) {
		this.localIDXPath = localIDXPath;
	}

	public String getResolveURLXPath() {
		return resolveURLXPath;
	}

	public void setResolveURLXPath(String resolveURLXPath) {
		this.resolveURLXPath = resolveURLXPath;
	}

	public String getTargetXPath() {
		return targetXPath;
	}

	public void setTargetXPath(String targetXPath) {
		this.targetXPath = targetXPath;
	}

	public void setBaseNodesXPath(String baseNodesXPath) {
		this.baseNodesXPath = baseNodesXPath;
	}

	public String getBaseNodesXPath() {
		return baseNodesXPath;
	}

	@Override
	public String toString() {
		return "PIDAssignmentRule [baseNodesXPath=" + baseNodesXPath + ", localIDXPath=" + localIDXPath + ", resolveURLXPath=" + resolveURLXPath
				+ ", targetXPath=" + targetXPath + ", locatts size = " + locattRules.size() + "]";
	}

}
