Package es.situm.sdk.model
Class I18nString
- java.lang.Object
-
- es.situm.sdk.model.I18nString
-
- All Implemented Interfaces:
android.os.Parcelable
,MapperInterface
public final class I18nString extends java.lang.Object implements android.os.Parcelable, MapperInterface
A string with a different value depending of the language. It's recommended to support a default valuedefaultValue()
(optional) for non supported languages.ISO 639-2 is used to identify the languages.
- See Also:
Locale.getISO3Language()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
I18nString.Builder
Allows creating a I18nString in a handier way.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANY_LANGUAGE
Special code, non ISO 693-2, to denote value to use by default.static android.os.Parcelable.Creator<I18nString>
CREATOR
static I18nString
EMPTY
-
Fields inherited from interface es.situm.sdk.model.MapperInterface
ACCESSIBILITY_MODE, ACCURACY, ADDRESS, ALTITUDE, BEARING, BEARING_FROM, BEARING_QUALITY, BOUNDS, BOUNDS_ROTATED, BUILDING, BUILDING_IDENTIFIER, BUILDING_NAME, CARTESIAN_BEARING, CARTESIAN_COORDINATE, CENTER, CLOSEST_LOCATION_IN_ROUTE, CODE, CONVERSION, COORDINATE, CREATED_AT, CURRENT_INDICATION, CURRENT_STEP_INDEX, CUSTOM_FIELDS, dateFormat, DEGREES, DEGREES_CLOCKWISE, DEVICE_ID, DIAGNOSTICS_OPTIONS_UPLOAD_DIAGNOSTICS_DATA, DIMENSIONS, DISTANCE, DISTANCE_TO_CHANGE_FLOOR_THRESHOLD, DISTANCE_TO_CHANGE_INDICATION_THRESHOLD, DISTANCE_TO_CLOSEST_POINT_IN_ROUTE, DISTANCE_TO_END_STEP, DISTANCE_TO_GOAL, DISTANCE_TO_GOAL_THRESHOLD, DISTANCE_TO_IGNORE_FIRST_INDICATION, DISTANCE_TO_NEXT_LEVEL, EDGES, EVENTS, EXCLUDED_TAGS, EXTERNAL_NAVIGATION_PAYLOAD, EXTERNAL_NAVIGATION_TYPE, FIRST_STEP, FLOOR, FLOOR_IDENTIFIER, FLOORS, FOREGROUND_SERVICE_NOTIFICATION_MESSAGE, FOREGROUND_SERVICE_NOTIFICATION_SHOW_STOP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_STOP_ACTION_TEXT, FOREGROUND_SERVICE_NOTIFICATION_TAP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_TITLE, FROM, GEOFENCES, HAS_BEARING, HAS_CARTESIAN_BEARING, HEIGHT, HUMAN_READABLE_MESSAGE, ID, IDENTIFIER, IGNORE_LOW_QUALITY_LOCATIONS, INCLUDED_TAGS, INDICATION_TYPE, INDICATIONS, INDICATIONS_INTERVAL, INDOOR_POIS, INFO_HTML, IS_FIRST, IS_INDOOR, IS_LAST, IS_OUTDOOR, IS_PUBLIC, LAST_STEP, LATITUDE, LONGITUDE, MAP_URL, MINIMIZE_FLOOR_CHANGES, NAME, NEEDED_LEVEL_CHANGE, NEXT_INDICATION, NEXT_LEVEL, NODES, NORTH_EAST, NORTH_WEST, ORIENTATION, ORIENTATION_TYPE, OUTDOOR_BUILDING_DETECTOR_BLE, OUTDOOR_POIS, OUTSIDE_ROUTE_THRESHOLD, PICTURE_THUMB_URL, PICTURE_URL, POI_CATEGORIES, POI_CATEGORY, POI_CATEGORY_CODE, POI_CATEGORY_ICON_SELECTED, POI_CATEGORY_ICON_UNSELECTED, POI_CATEGORY_IDENTIFIER, POI_CATEGORY_IDENTIFIERS, POI_CATEGORY_iNAME, POI_CATEGORY_NAME, POI_NAME, POI_TO, POI_TO_IDENTIFIER, POINTS, POLYGON_POINTS, POSITION, PROVIDER, QUALITY, RADIANS, RADIANS_MINUS_PI_PI, RADIUS, ROTATION, ROUND_INDICATIONS_STEP, ROUTE, ROUTE_STEP, SCALE, SEGMENTS, SOUTH_EAST, SOUTH_WEST, STATUS_NAME, STATUS_ORDINAL, STEP_IDX_DESTINATION, STEP_IDX_ORIGIN, STEPS, TIME_TO_END_STEP, TIME_TO_FIRST_INDICATION, TIME_TO_GOAL, TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES, TIMESTAMP, TO, TO_LEGACY, TRIGGER, UPDATED_AT, USER_IDENTIFIER, WIDTH, X, Y
-
-
Constructor Summary
Constructors Constructor Description I18nString(java.util.Map<java.lang.String,java.lang.String> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
defaultValue()
int
describeContents()
boolean
equals(java.lang.Object o)
java.lang.String
get(java.lang.String language)
Obtains the string in the provided language.java.lang.String
get(java.util.Locale locale)
Obtains the string in the provided Locale's language Wrapsget(String)
, usingLocale.getISO3Language()
to take language code.boolean
has(java.lang.String language)
Check if the language is supported by this I18nStringint
hashCode()
java.util.Map<java.lang.String,java.lang.Object>
toMap()
Method to transform object into Mapjava.lang.String
toString()
void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
EMPTY
public static final I18nString EMPTY
-
ANY_LANGUAGE
public static final java.lang.String ANY_LANGUAGE
Special code, non ISO 693-2, to denote value to use by default.- See Also:
- Constant Field Values
-
CREATOR
public static final android.os.Parcelable.Creator<I18nString> CREATOR
-
-
Method Detail
-
get
@NonNull public java.lang.String get(@NonNull java.lang.String language)
Obtains the string in the provided language. If there is no value for that language, return value forANY_LANGUAGE
- Parameters:
language
- ISO 639-2 language name representation, orANY_LANGUAGE
. If is null, will check for ANY_LANGUAGE- Returns:
String
. Empty if there is no value for this language, or if provided language is null or empty.
-
get
@NonNull public java.lang.String get(@NonNull java.util.Locale locale)
Obtains the string in the provided Locale's language Wrapsget(String)
, usingLocale.getISO3Language()
to take language code.- Parameters:
locale
- itsLocale.getISO3Language()
stands for the language.- Returns:
String
. Empty if there is no value for this language.- Throws:
java.lang.IllegalArgumentException
- if locale is null
-
defaultValue
@NonNull public java.lang.String defaultValue()
-
has
public boolean has(@NonNull java.lang.String language)
Check if the language is supported by this I18nString- Parameters:
language
- ISO 639-2 language name representation. Not null.- Returns:
- true if there is some value for this string, false otherwise.
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
Description copied from interface:MapperInterface
Method to transform object into Map- Specified by:
toMap
in interfaceMapperInterface
- Returns:
- Map
with the information of the object mapped
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-