pl.fhframework.UseCaseAdapter Maven / Gradle / Ivy
package pl.fhframework;
import pl.fhframework.core.FhFormException;
import pl.fhframework.core.uc.*;
import pl.fhframework.model.PresentationStyleEnum;
import pl.fhframework.model.forms.Form;
import java.util.function.Consumer;
/**
* Created by pawel.ruta on 17.02.2017.
*
* Deprecated - należy używać intefejsów IUseCaseOneInput, IUseCaseNoInput, IUseCaseTwoInput
*/
@Deprecated
public abstract class UseCaseAdapter implements IUseCase {
public > F wyswietlFormatke(String identyfikatorFormatki, T model) {
return showForm((Class) dajKlase(identyfikatorFormatki), model);
}
public > F wyswietlFormatke(String identyfikatorFormatki, T model, String variantId) {
return showForm((Class) dajKlase(identyfikatorFormatki), model, variantId);
}
public > F wyswietlFormatke(Class formClazz, T model) {
return showForm(formClazz, model);
}
public > F wyswietlFormatke(Class formClazz, T model, String formVariant) {
return showForm(formClazz, model, formVariant);
}
public void zamknijFormatke(Form form) {
hideForm(form);
}
public void wyswietlFormatke(Form form) {
showForm(form);
}
public UserSession getSesjaUzytkownika() {
return getUserSession();
}
public void zglosBladWalidacji(Object parent, String attributeName, String message, PresentationStyleEnum errorStyle) {
reportValidationError(parent, attributeName, message, errorStyle);
}
public >> void uruchomPodprzypadek(Class klasaPodprzypadkuUzycia, INPUT daneWejsciowe, Consumer metodaDlaWyjscia1, Consumer metodaDlaWyjscia2) {
runSubUseCase(klasaPodprzypadkuUzycia, daneWejsciowe, IUseCaseTwoOutputCallback.getCallback(metodaDlaWyjscia1, metodaDlaWyjscia2));
}
public >> void uruchomPodprzypadek(Class klasaPodprzypadkuUzycia, INPUT daneWejsciowe, Consumer