Class PreferenceItem
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.preferences.PreferenceItem
-
public class PreferenceItem extends java.lang.ObjectThis class models a Preference item which can be added to aPreferences. Typical preferences include language and parental control restrictions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPreferenceItem.Field
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetField(java.lang.String key)Retrieves the value of the specified field from the preferences.java.util.Map<java.lang.String,java.util.List<java.lang.String>>getGenres()Gets the preferred genre for the passenger.java.lang.IntegergetInteractiveBrightness()Gets the preferred interactive brightness.java.lang.StringgetInteractiveTheme()Gets the preferred interactive theme.java.lang.StringgetLanguage()Gets the preferred language for the passenger.java.lang.StringgetParentalControlRating()Gets the preferred parental control rating, such as G (general) and GP (general with parential guidance), for the passenger.java.lang.StringgetSoundtrackLanguage()Gets the preferred soundtrack language for the passenger.java.lang.StringgetSubtitleLanguage()Gets the preferred subtitle language for the passenger.java.lang.StringtoString()
-
-
-
Method Detail
-
getInteractiveTheme
public java.lang.String getInteractiveTheme()
Gets the preferred interactive theme.- Returns:
-
getInteractiveBrightness
public java.lang.Integer getInteractiveBrightness()
Gets the preferred interactive brightness.- Returns:
-
getLanguage
public java.lang.String getLanguage()
Gets the preferred language for the passenger. The specified language displays in media content.
The language is specified as ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app. that displays on the seatback monitor.- Returns:
- java.lang.String ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
-
getParentalControlRating
public java.lang.String getParentalControlRating()
Gets the preferred parental control rating, such as G (general) and GP (general with parential guidance), for the passenger.- Returns:
- java.lang.String Parential control rating
-
getSubtitleLanguage
public java.lang.String getSubtitleLanguage()
Gets the preferred subtitle language for the passenger. The specified language displays in media content.
The language is specified as ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.- Returns:
- java.lang.String ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
-
getSoundtrackLanguage
public java.lang.String getSoundtrackLanguage()
Gets the preferred soundtrack language for the passenger. The specified language displays in media content.
The language is specified as ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.- Returns:
- java.lang.String ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
-
getGenres
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getGenres()
Gets the preferred genre for the passenger. The genre displays in the media conttent.
The call provides a map of content types, such as movies, tv and music, with the list of genres, such as comedy and horror.- Returns:
- maps contentType with the list of genres.
-
getField
public java.lang.Object getField(java.lang.String key)
Retrieves the value of the specified field from the preferences. The key should be a non-null string corresponding to the field whose value needs to be fetched. The returned value will be of typeObjectand should be cast to the appropriate type by the caller.Possible keys and their associated types include:
- "food_allergies": A list of allergies. Cast to
JSONArray.JSONArray foodAllergies = (JSONArray) getField("food_allergies"); - "meal_preferences": A list of meal preferences. Cast to
JSONArray.JSONArray mealPreferences = (JSONArray) getField("meal_preferences"); - "drink_preferences": A list of drink preferences. Cast to
JSONArray.JSONArray drinkPreferences = (JSONArray) getField("drink_preferences"); - "subtitle_language": Language code for subtitles. Cast to
String.String subtitleLanguage = (String) getField("subtitle_language"); - "soundtrack_language": Language code for soundtrack. Cast to
String.String soundtrackLanguage = (String) getField("soundtrack_language"); - "interactive_language": Language code for interactive content. Cast to
String.String interactiveLanguage = (String) getField("interactive_language"); - "interactive_volume": Volume level for interactive content. Cast to
Integer.Integer interactiveVolume = (Integer) getField("interactive_volume"); - "interactive_brightness": Brightness level for interactive content. Cast to
Integer.Integer interactiveBrightness = (Integer) getField("interactive_brightness"); - "interactive_theme": Name of the interactive theme. Cast to
String.String interactiveTheme = (String) getField("interactive_theme"); - "interactive_shortcuts": List of interactive shortcuts. Each shortcut is represented as a map with keys
"cid"and"content_scope". Cast toJSONArray.JSONArray interactiveShortcuts = (JSONArray) getField("interactive_shortcuts"); - "unit_of_distance": Measurement unit for distance. Cast to
String.String unitOfDistance = (String) getField("unit_of_distance"); - "clock_hour_format": Hour format for clock. Cast to
String.String clockHourFormat = (String) getField("clock_hour_format"); - "temperature_degree": Degree unit for temperature. Cast to
String.String temperatureDegree = (String) getField("temperature_degree"); - "chronotype": Chronotype identifier. Cast to
Integer.Integer chronotype = (Integer) getField("chronotype"); - "caffeine_use": Flag indicating caffeine use. Cast to
Boolean.Boolean caffeineUse = (Boolean) getField("caffeine_use"); - "melatonin_use": Flag indicating melatonin use. Cast to
Boolean.Boolean melatoninUse = (Boolean) getField("melatonin_use"); - "sleep_pattern": Object containing sleep and wake times. Cast to
JSONObject.JSONObject sleepPattern = (JSONObject) getField("sleep_pattern"); - "seat_light_settings": List of seat light settings for different aircraft models and scenes. Cast to
JSONArray.JSONArray seatLightSettings = (JSONArray) getField("seat_light_settings"); - "seat_control_settings": List of seat control settings for different aircraft and classes. Cast to
JSONArray.JSONArray seatControlSettings = (JSONArray) getField("seat_control_settings"); - "genre": Object specifying genre preferences for different media types. Cast to
JSONObject.JSONObject genrePreferences = (JSONObject) getField("genre"); - "crew_notes": Notes for crew members. Cast to
String.String crewNotes = (String) getField("crew_notes");
- Parameters:
key- the key for the field to retrieve- Returns:
- the value of the specified field, or
nullif the field is not found - Throws:
java.lang.IllegalArgumentException- if the key is null
- "food_allergies": A list of allergies. Cast to
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-