Interface DescriptionStorage
- All Superinterfaces:
DescriptionService
-
Method Summary
Modifier and TypeMethodDescriptiongetDescription(String id) Returns the default description or null if it does not exist.getDescription(String id, Locale locale) Returns a description for the specified locale argument or null if it does not exist.Returns a map containing all the descriptions of an object or null if the object is not internationalized.resolveDescription(String id, Locale locale) Resolve a description with thelocaleargument.resolveDescription(String id, Locale locale2, Locale locale1) Resolve a description, thelocale1argument specifies which locale is relevant for retrieval, thelocale2specifies which locale should be defaulted to when thelocale1cannot provide any relevant match.voidsetDescription(String id, Locale locale, State description) Update the description for the specified locale to the new description or remove it if the description argument is null.voidsetDescription(String id, State description) Update the default description to the new description or remove it if the description argument is null.voidsetDescriptions(String id, Map<Locale, State> descriptions) Updates the description of the specified object or remove the internationalized characteristic of the object if the description map is null.
-
Method Details
-
resolveDescription
Resolve a description with the
localeargument.- Specified by:
resolveDescriptionin interfaceDescriptionService- Parameters:
id- the object idlocale- the locale to resolve- Returns:
- the description
-
resolveDescription
Resolve a description, the
The resolution follows those rules:locale1argument specifies which locale is relevant for retrieval, thelocale2specifies which locale should be defaulted to when thelocale1cannot provide any relevant match. Thelocale2argument is optional.- The resolution is performed against the locale1.
- When the locale1 does not resolve and a locale2 is provided, a resolution is performed with locale2.
- Otherwise null is returned.
- Specified by:
resolveDescriptionin interfaceDescriptionService- Parameters:
id- the object idlocale2- the first localelocale1- the second locale- Returns:
- the description
-
getDescription
Returns the default description or null if it does not exist.- Specified by:
getDescriptionin interfaceDescriptionService- Parameters:
id- the object id- Returns:
- the description
-
setDescription
Update the default description to the new description or remove it if the description argument is null.- Specified by:
setDescriptionin interfaceDescriptionService- Parameters:
id- the object iddescription- the new description
-
getDescription
Returns a description for the specified locale argument or null if it does not exist.- Specified by:
getDescriptionin interfaceDescriptionService- Parameters:
id- the object idlocale- the locale- Returns:
- the description
-
setDescription
Update the description for the specified locale to the new description or remove it if the description argument is null.- Specified by:
setDescriptionin interfaceDescriptionService- Parameters:
id- the object idlocale- the localedescription- the new description
-
getDescriptions
Returns a map containing all the descriptions of an object or null if the object is not internationalized.- Specified by:
getDescriptionsin interfaceDescriptionService- Parameters:
id- the object id- Returns:
- the map the description map
-
setDescriptions
Updates the description of the specified object or remove the internationalized characteristic of the object if the description map is null.- Specified by:
setDescriptionsin interfaceDescriptionService- Parameters:
id- the object iddescriptions- the new descriptions
-