java.lang.Object
me.remigio07.chatplugin.api.server.ad.Ad

public class Ad extends Object
Represents an ad handled by the AdManager.
See Also:
  • Constructor Details

  • Method Details

    • getID

      public String getID()
      Gets this ad's ID.
      Returns:
      Ad's ID
    • getTexts

      public Map<Language,String> getTexts()
      Gets this ad's texts.

      You may modify the returned map, but it cannot point to a null value for Language.getMainLanguage().

      Returns:
      Ad's texts
    • getText

      public String getText(Language language, boolean avoidNull)
      Gets this ad's text for the specified language.

      Specify true as avoidNull to fall back to Language.getMainLanguage()'s text if no text is present for the specified language. Will return null if getTexts().get(language) == null && !avoidNull.

      Parameters:
      language - Language used to translate the text
      avoidNull - Whether to avoid returning null
      Returns:
      Ad's text
    • getHovers

      public Map<Language,String> getHovers()
      Gets this ad's hovers.

      You may modify the returned map.

      Returns:
      Ad's hovers
    • getHover

      public String getHover(Language language)
      Gets this ad's hover for the specified language.

      Will return null if getHovers().get(language) == null.

      Parameters:
      language - Language used to translate the hover
      Returns:
      Ad's hover
    • getClickAction

      public ClickActionAdapter getClickAction()
      Gets this ad's click action.

      Will return null if the click action has not been specified.

      Returns:
      Ad's click action
    • setClickAction

      public Ad setClickAction(ClickActionAdapter clickAction)
      Sets this ad's click action.

      Specify null to not specify a click action.

      Parameters:
      clickAction - Ad's click action
      Returns:
      This ad
    • getClickValues

      public Map<Language,String> getClickValues()
      Gets this ad's click values.

      You may modify the returned map.

      Returns:
      Ad's click values
    • getClickValue

      public String getClickValue(Language language)
      Gets this ad's click value for the specified language.

      Will return null if getClickValues().get(language) == null.

      Parameters:
      language - Language used to translate the click value
      Returns:
      Ad's click value
    • getDisabledRanks

      public List<Rank> getDisabledRanks()
      Gets the list of ranks that will not receive this ad.

      You may modify the returned list.

      Returns:
      Ad's disabled ranks