Class InfoKey<T>

java.lang.Object
me.hsgamer.hscore.downloader.core.object.InfoKey<T>
Type Parameters:
T - the type of the final value

public abstract class InfoKey<T> extends Object
A key to get value from the download info
  • Constructor Details

    • InfoKey

      public InfoKey(@NotNull @NotNull String key, @NotNull T defaultValue)
      Create an info key
      Parameters:
      key - the key to the value
      defaultValue - the default value
  • Method Details

    • getKey

      @NotNull public final @NotNull String getKey()
      Get the key to the value
      Returns:
      the key
    • getDefaultValue

      @NotNull public final T getDefaultValue()
      Get the default value
      Returns:
      the default value
    • convertType

      @Nullable public abstract T convertType(@NotNull @NotNull Object object)
      Convert the type of the value from the raw value
      Parameters:
      object - the raw value
      Returns:
      the converted value
    • get

      @NotNull public final T get(@NotNull @NotNull DownloadInfo downloadInfo)
      Get the value from the download info
      Parameters:
      downloadInfo - the download info
      Returns:
      the value