Package eu.c6.gibraltar.api.common
Class Labels
java.lang.Object
eu.c6.gibraltar.api.common.CObject
eu.c6.gibraltar.api.common.Labels
- All Implemented Interfaces:
ICObject,ILabels,Serializable,Cloneable
The Class Labels to manage localized labels.
Example :
ILabels labels = new Labels(); labels.setLabel(Locale.FRANCE, "My label FR"); labels.setLabel(Locale.ENGLISH, "My label EN"); String labelFr = labels.getLocalizedValue(Locale.FRANCE);
- See Also:
-
Field Summary
Fields inherited from interface eu.c6.gibraltar.api.common.ICObject
CHARSET, FIELD_SEPARATOR_DOT, FIELD_SEPARATOR_PATHFields inherited from interface eu.c6.gibraltar.api.common.ILabels
FIELD_LABEL, FIELD_LOCALE, FIELD_VALUES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLabelAsString(Locale locale) Gets the label as string representation.Gets the label locales.Gets the localized map values to have all localized labelsgetLocalizedMapValues(String defaultValue, Locale fallbackLocale) Gets the localized map values to have all localized labelsgetLocalizedValue(Locale locale) Gets the localized value for a locale.getLocalizedValue(Locale locale, String defValue) Gets the localized value for a locale.getLocalizedValue(Locale locale, String defValue, Locale fallbackLocale) Gets the localized value for a locale.booleanChecks for no label value.booleanhasNoLabelValue(Locale searchLocale) Checks for no label value for a locale.voidremoveLabel(Locale locale) Removes the label for a locale.voidSets the label for a locale.voidsetLocalizedMapValue(Map<Locale, String> values) Sets the localized map values.Methods inherited from class eu.c6.gibraltar.api.common.CObject
addIntoList, addValueIntoList, buildPath, clearList, clone, clone, clone, contains, containsField, convertFieldNameToJsonPath, convertJsonPathToFieldName, equals, get, getBoolean, getBoolean, getDate, getDate, getDouble, getDouble, getFieldNames, getFieldNamesFlattenList, getFieldNamesList, getInputStream, getInt, getInt, getList, getListNestedObject, getListNestedObject, getListNestedObject, getListNestedObjectByAttribute, getListNestedObjectByAttribute, getListSize, getListString, getLocalDateTime, getLocalDateTime, getLong, getLong, getNestedObject, getNestedObject, getNestedObject, getNestedObjectNamesList, getOutputStream, getReader, getString, getString, insertIntoList, isBoolean, isDate, isDateList, isDouble, isEmpty, isFieldEmpty, isInt, isJSONValid, isList, isNestedObject, isNestedObjectList, isString, load, load, merge, mergeDeep, parse, remove, removeFromList, removeValueFromList, replaceIntoList, resetField, set, set, set, set, set, set, set, set, set, setList, setNull, textValue, toFlattenMapValues, toJson, toMap, toString, toStringMethods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface eu.c6.gibraltar.api.common.ICObject
addIntoList, addValueIntoList, clearList, clone, clone, clone, contains, containsField, equals, get, getBoolean, getBoolean, getDate, getDate, getDouble, getDouble, getFieldNames, getFieldNamesFlattenList, getFieldNamesList, getInputStream, getInt, getInt, getList, getListNestedObject, getListNestedObject, getListNestedObject, getListNestedObjectByAttribute, getListNestedObjectByAttribute, getListSize, getListString, getLocalDateTime, getLocalDateTime, getLong, getLong, getNestedObject, getNestedObject, getNestedObject, getNestedObjectNamesList, getOutputStream, getReader, getString, getString, insertIntoList, isBoolean, isDate, isDateList, isDouble, isEmpty, isFieldEmpty, isInt, isList, isNestedObject, isNestedObjectList, isString, load, load, merge, mergeDeep, remove, removeFromList, removeValueFromList, replaceIntoList, resetField, set, set, set, set, set, set, set, set, set, setList, setNull, textValue, toFlattenMapValues, toJson, toMap, toString, toString
-
Constructor Details
-
Labels
Instantiates a new Labels from ICObject instance.- Parameters:
obj- the ICObject instance
-
Labels
public Labels()Instantiates a new Labels. -
Labels
Instantiates a new Labels from map of values and locales.- Parameters:
values- the values
-
-
Method Details
-
getLocales
Description copied from interface:ILabelsGets the label locales.- Specified by:
getLocalesin interfaceILabels- Returns:
- the locales
-
getLocalizedMapValues
Description copied from interface:ILabelsGets the localized map values to have all localized labels- Specified by:
getLocalizedMapValuesin interfaceILabels- Returns:
- the localized map of label values
-
getLocalizedMapValues
Description copied from interface:ILabelsGets the localized map values to have all localized labels- Specified by:
getLocalizedMapValuesin interfaceILabels- Parameters:
defaultValue- the default value if label is NULL or emptyfallbackLocale- the fallback locale to use if label is empty or NULL- Returns:
- the localized map values
-
getLocalizedValue
Description copied from interface:ILabelsGets the localized value for a locale.- Specified by:
getLocalizedValuein interfaceILabels- Parameters:
locale- the locale- Returns:
- the localized value
-
getLocalizedValue
Description copied from interface:ILabelsGets the localized value for a locale.- Specified by:
getLocalizedValuein interfaceILabels- Parameters:
locale- the localedefValue- the default value if locale is not managed and default locale has not valuefallbackLocale- the fallback locale if locale is not managed- Returns:
- the localized value
-
getLocalizedValue
Description copied from interface:ILabelsGets the localized value for a locale.- Specified by:
getLocalizedValuein interfaceILabels- Parameters:
locale- the localedefValue- the default value if locale is not managed- Returns:
- the localized value
-
setLocalizedMapValue
Description copied from interface:ILabelsSets the localized map values.- Specified by:
setLocalizedMapValuein interfaceILabels- Parameters:
values- the values
-
setLabel
Description copied from interface:ILabelsSets the label for a locale. -
removeLabel
Description copied from interface:ILabelsRemoves the label for a locale.- Specified by:
removeLabelin interfaceILabels- Parameters:
locale- the locale
-
getLabelAsString
Description copied from interface:ILabelsGets the label as string representation.- Specified by:
getLabelAsStringin interfaceILabels- Parameters:
locale- the locale- Returns:
- the label as string
-
hasNoLabelValue
public boolean hasNoLabelValue()Description copied from interface:ILabelsChecks for no label value.- Specified by:
hasNoLabelValuein interfaceILabels- Returns:
- true, if one of the label is NULL or empty
-
hasNoLabelValue
Description copied from interface:ILabelsChecks for no label value for a locale.- Specified by:
hasNoLabelValuein interfaceILabels- Parameters:
searchLocale- the locale- Returns:
- true, if label of the locale is NULL or empty
-