public class TemplateInstanceBean extends TemplateDefinitionBean
The template definition with variables, messages and locale ready to render.
Modifier and Type | Class and Description |
---|---|
static class |
TemplateInstanceBean.TemplateInstanceBeanBuilder<C extends TemplateInstanceBean,B extends TemplateInstanceBean.TemplateInstanceBeanBuilder<C,B>> |
TemplateDefinitionBean.TemplateDefinitionBeanBuilder<C extends TemplateDefinitionBean,B extends TemplateDefinitionBean.TemplateDefinitionBeanBuilder<C,B>>
DEFAULT_CHARSET, DEFAULT_CONTENT_TYPE
Modifier | Constructor and Description |
---|---|
|
TemplateInstanceBean() |
|
TemplateInstanceBean(org.springframework.context.MessageSource messages,
Map<String,Object> variables,
Locale locale) |
protected |
TemplateInstanceBean(TemplateInstanceBean.TemplateInstanceBeanBuilder<?,?> b) |
Modifier and Type | Method and Description |
---|---|
static TemplateInstanceBean.TemplateInstanceBeanBuilder<?,?> |
builder() |
static TemplateInstanceBean.TemplateInstanceBeanBuilder |
buildInstance(TemplateDefinitionBean definition)
|
static TemplateInstanceBean.TemplateInstanceBeanBuilder |
buildInstance(TemplateDefinitionBean definition,
Locale locale)
|
static TemplateInstanceBean.TemplateInstanceBeanBuilder |
buildInstance(TemplateDefinitionBean definition,
Locale locale,
String baseNames)
|
static TemplateInstanceBean.TemplateInstanceBeanBuilder |
buildInstance(TemplateDefinitionBean definition,
String baseNames)
Build an instance with default
locale and a resource messages from baseNames and an empty getVariables() . |
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
Locale |
getLocale()
The locale to use in i18n.
|
org.springframework.context.MessageSource |
getMessages()
Messages to use in i18n.
|
Map<String,Object> |
getVariables()
A map with key-values to apply on rendering.
|
int |
hashCode() |
void |
setLocale(@NotNull Locale locale)
The locale to use in i18n.
|
void |
setMessages(@NotNull org.springframework.context.MessageSource messages)
Messages to use in i18n.
|
void |
setVariables(@NotNull Map<String,Object> variables)
A map with key-values to apply on rendering.
|
TemplateInstanceBean.TemplateInstanceBeanBuilder<?,?> |
toBuilder() |
String |
toString() |
getCharSet, getContentType, getName, getTemplate, getTemplateEngineLanguage, setCharSet, setContentType, setName, setTemplate, setTemplateEngineLanguage
protected TemplateInstanceBean(TemplateInstanceBean.TemplateInstanceBeanBuilder<?,?> b)
public TemplateInstanceBean()
public static TemplateInstanceBean.TemplateInstanceBeanBuilder buildInstance(TemplateDefinitionBean definition)
Build an instance with Locale.getDefault()
and without getMessages()
and an empty getVariables()
.
definition
- The template definitionpublic static TemplateInstanceBean.TemplateInstanceBeanBuilder buildInstance(TemplateDefinitionBean definition, Locale locale)
Build an instance with locale
and without getMessages()
and an empty getVariables()
.
definition
- The template definitionlocale
- The localepublic static TemplateInstanceBean.TemplateInstanceBeanBuilder buildInstance(TemplateDefinitionBean definition, String baseNames)
Build an instance with default locale
and a resource messages
from baseNames
and an empty getVariables()
.
definition
- The template definitionbaseNames
- The base names or messages for search forpublic static TemplateInstanceBean.TemplateInstanceBeanBuilder buildInstance(TemplateDefinitionBean definition, Locale locale, String baseNames)
Build an instance with locale
and a resource messages
from baseNames
and an empty getVariables()
.
definition
- The template definitionlocale
- The localebaseNames
- The base names or messages for search forpublic static TemplateInstanceBean.TemplateInstanceBeanBuilder<?,?> builder()
public TemplateInstanceBean.TemplateInstanceBeanBuilder<?,?> toBuilder()
toBuilder
in class TemplateDefinitionBean
public org.springframework.context.MessageSource getMessages()
Messages to use in i18n.
public Map<String,Object> getVariables()
A map with key-values to apply on rendering.
public Locale getLocale()
The locale to use in i18n.
public String toString()
toString
in class TemplateDefinitionBean
public boolean equals(Object o)
equals
in class TemplateDefinitionBean
protected boolean canEqual(Object other)
canEqual
in class TemplateDefinitionBean
public int hashCode()
hashCode
in class TemplateDefinitionBean
public void setMessages(@NotNull @NotNull org.springframework.context.MessageSource messages)
Messages to use in i18n.
messages
- The message source to usepublic void setVariables(@NotNull @NotNull Map<String,Object> variables)
A map with key-values to apply on rendering.
variables
- The map with values to usepublic void setLocale(@NotNull @NotNull Locale locale)
The locale to use in i18n.
locale
- The locale to useCopyright © 2021 Albirar. All rights reserved.