com.xlrit.gears.base.form.AbstractCompanion Maven / Gradle / Ivy
package com.xlrit.gears.base.form;
import java.util.Objects;
import com.xlrit.gears.base.choice.ChoicesFactory;
import com.xlrit.gears.base.execution.Execution;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public abstract class AbstractCompanion implements Companion {
private static final Logger LOG = LoggerFactory.getLogger(AbstractCompanion.class);
@Autowired
protected ChoicesFactory choicesFactory;
protected final Class extends Form> formClass;
protected AbstractCompanion(Class extends Form> formClass) {
this.formClass = Objects.requireNonNull(formClass);
}
@Override
public boolean forFormClass(Class extends Form> formClass) {
LOG.debug("forFormClass: {} == {}: {}", this.formClass, formClass, this.formClass == formClass);
return this.formClass == formClass;
}
@Override
public Object getBasedOn(Execution execution) {
return null;
}
}