package com.krishagni.catissueplus.core.biospecimen.label.visit;

import com.krishagni.catissueplus.core.biospecimen.domain.Visit;
import com.krishagni.catissueplus.core.common.domain.AbstractLabelTmplToken;
import com.krishagni.catissueplus.core.common.domain.LabelTmplToken;
import com.krishagni.catissueplus.core.common.errors.OpenSpecimenException;

public abstract class AbstractVisitLabelToken extends AbstractLabelTmplToken implements LabelTmplToken {
	protected String name = "";

	@Override
	public String getName() {
		return name;
	}

	@Override
	public String getReplacement(Object object) {
		return getReplacement(object, null);
	}

	@Override
	public String getReplacement(Object object, String... args) {
		if (!(object instanceof Visit)) {
			throw new RuntimeException("Invalid input object type");
		}

		return getLabel((Visit)object, args);
	}
	
	public abstract String getLabel(Visit visit, String... args);
}

@@ -624,21 +624,16 @@
 ment
+0
 (object
-, null
 );%0A%09
@@ -709,16 +709,189 @@
 args) %7B%0A
+%09%09return getReplacement0(object, args);%0A%09%7D%0A%0A%09public abstract String getLabel(Visit visit, String... args);%0A%0A%09private String getReplacement0(Object object, String... args) %7B%0A
 %09%09if (!(
@@ -1027,74 +1027,9 @@
 s);%0A
+
 %09%7D%0A
-%09%0A%09public abstract String getLabel(Visit visit, String... args);%0A
 %7D%0A

Fix compile time warnings.