com.commercetools.sunrise.common.template.engine.TemplateContext Maven / Gradle / Ivy
package com.commercetools.sunrise.common.template.engine;
import com.commercetools.sunrise.cms.CmsPage;
import com.commercetools.sunrise.common.pages.PageData;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
public class TemplateContext {
private final PageData pageData;
private final List locales;
@Nullable
private final CmsPage cmsPage;
public TemplateContext(final PageData pageData, final List locales, final CmsPage cmsPage) {
this.pageData = pageData;
this.locales = locales;
this.cmsPage = cmsPage;
}
public PageData pageData() {
return pageData;
}
public List locales() {
return locales;
}
public Optional cmsPage() {
return Optional.ofNullable(cmsPage);
}
}