java.lang.Object
de.focus_shift.jollyday.core.util.ResourceUtil

public final class ResourceUtil extends Object
  • Field Details

    • UNDEFINED

      public static final String UNDEFINED
      Unknown constant will be returned when there is no description configured.
      See Also:
  • Method Details

    • getHolidayDescription

      public static @NonNull String getHolidayDescription(@NonNull String key)
      The description read with the default locale.
      Parameters:
      key - a String object.
      Returns:
      holiday description using default locale.
    • getHolidayDescription

      public static @NonNull String getHolidayDescription(@NonNull Locale locale, @NonNull String key)
      The description read with the provided locale.
      Parameters:
      locale - a Locale object.
      key - a String object.
      Returns:
      holiday description using the provided locale.
    • getCountryDescription

      public static @NonNull String getCountryDescription(@NonNull String key)

      getCountryDescription.

      Parameters:
      key - a String object.
      Returns:
      the description
    • getCountryDescription

      public static @NonNull String getCountryDescription(@NonNull Locale locale, @Nullable String key)
      Returns the hierarchies description text from the resource bundle.
      Parameters:
      locale - Locale to return the description text for.
      key - a String object.
      Returns:
      Description text
    • getResource

      public static @NonNull Optional<URL> getResource(@NonNull String resourceName)
      Returns the resource by URL.
      Parameters:
      resourceName - the name/path of the resource to load
      Returns:
      the URL to the resource
    • getResource

      public static @NonNull Optional<URL> getResource(@NonNull String resourceName, boolean searchOnlyInJar)
      Returns the resource by URL.
      Parameters:
      resourceName - the name/path of the resource to load
      searchOnlyInJar - if true searches for the given resourceName only in resource with the protocol 'jar' otherwise the protocol is irrelevant
      Returns:
      the optional URL to the resource