Class JellyfinRatingList
This class maintains an internal list of rating strings commonly used by Jellyfin. It exposes methods to load, reload, and retrieve those ratings as either a live list or a string array suitable for UI components such as combo boxes or dropdowns.
Example usage:
JellyfinRatingList r = new JellyfinRatingList(); r.JellyfinRatingList(); // populate (note: this is not a constructor) String[] items = r.getItems();
Notes:
- The method named JellyfinRatingList() is not a Java constructor;
it is a regular method that populates the list when invoked.
- The class is not thread-safe: concurrent modification of the returned
list from multiple threads may produce undefined behavior.
- Since:
- 1.0
- Author:
- Cesar Bianchi
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JellyfinRatingList
public JellyfinRatingList()
-
-
Method Details
-
JellyfinRatingList
public void JellyfinRatingList()Populates the internal list with the default ratings.Note: this method is named like a constructor but is declared with a return type and therefore is not a true Java constructor. Callers can invoke this method to explicitly populate the internal list, or use the other accessors which ensure the list is populated when needed.
- Since:
- 1.0
-
loadRatings
public void loadRatings()Populates the internal ratings list with a predefined set of Jellyfin content rating labels.This method appends to the existing list; callers who want a fresh set should call
reloadRatings()first.- Since:
- 1.0
-
getRatings
Returns the live internal ratings list.Warning: the returned list is the internal backing list and modifications to it will affect this object's state.
- Returns:
- the live
ArrayListof rating strings (may be empty) - Since:
- 1.0
-
getItems
Returns the ratings as a string array.This method ensures the internal list is freshly loaded before converting it to an array suitable for UI components such as dropdowns.
- Returns:
- an array containing the current rating labels; never
null - Since:
- 1.0
-