Interface IScopedLocalizedDatabaseObjectProviding<TData extends Serializable,TLocalization extends IScopedLocalizedDatabaseObject<TData,?>>
-
- Type Parameters:
TData
- type of the localized data. This may be a String, a file object or any other type of data.TLocalization
- type of the localized database object that provides the localized data.
public interface IScopedLocalizedDatabaseObjectProviding<TData extends Serializable,TLocalization extends IScopedLocalizedDatabaseObject<TData,?>>
Common interface for all objects (mainly entities) that provide localized data for different scopes.- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_LOCALIZATIONS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Set<String>
getKeys()
Gets the keys provided by this object.default Set<Locale>
getLocales()
Gets the locales provided by this object.default TLocalization
getLocalization(String key, Locale locale)
Gets the localized database object for the given key (I18N name) and locale.default TData
getLocalizationData(String key, Locale locale)
Gets the localized data for the given key (I18N name) and locale.List<TLocalization>
getLocalizations()
Gets the localized database objects.boolean
isDefault(TLocalization localization)
Checks if the given localization is the default localization.boolean
isEmpty(TData data)
Checks if the given data is empty.
-
-
-
Field Detail
-
ATTR_LOCALIZATIONS
static final String ATTR_LOCALIZATIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKeys
default Set<String> getKeys()
Gets the keys provided by this object. The keys are the I18N names identifying the localized database objects.- Returns:
- the keys provided by this object
-
getLocales
default Set<Locale> getLocales()
Gets the locales provided by this object.- Returns:
- the locales provided by this object
-
getLocalizations
List<TLocalization> getLocalizations()
Gets the localized database objects.- Returns:
- the localized database objects
-
getLocalization
default TLocalization getLocalization(String key, Locale locale)
Gets the localized database object for the given key (I18N name) and locale.- Parameters:
key
- to get the localized database object forlocale
- to get the localized database object for.- Returns:
- The localized database object for the given key (I18N name) and locale
-
getLocalizationData
default TData getLocalizationData(String key, Locale locale)
Gets the localized data for the given key (I18N name) and locale.- Parameters:
key
- to get the localized data forlocale
- to get the localized data for.- Returns:
- The localized data for the given key (I18N name) and locale
-
isDefault
boolean isDefault(TLocalization localization)
Checks if the given localization is the default localization.- Parameters:
localization
- The localization to check.- Returns:
true
if the localization is the default localization,false
otherwise.
-
isEmpty
boolean isEmpty(TData data)
Checks if the given data is empty.- Parameters:
data
- The data to check.- Returns:
true
if the data is empty,false
otherwise.
-
-