java.lang.Object
de.bytestore.hostinger.components.cards.template.DynamicCard
All Implemented Interfaces:
CardConfigListener, CardIdListener, CardValueListener
Direct Known Subclasses:
ImageTitleProviderCard, TextProviderCard, UsageProviderCard

@Component @Configurable public class DynamicCard extends Object implements CardIdListener, CardValueListener, CardConfigListener
  • Constructor Details

    • DynamicCard

      public DynamicCard()
  • Method Details

    • setCard

      public void setCard(Card cardIO)
      Sets the card object for this instance and updates its associated ID to the fully qualified class name of the provided card.
      Parameters:
      cardIO - The Card object to be set for this instance.
    • getCard

      public Card getCard()
      Retrieves a clone of the Card object associated with this instance.
      Returns:
      A clone of the Card object.
    • storeConfiguration

      public void storeConfiguration(String idIO)
      Stores the configuration values for the dynamic card. The configuration values are stored using the cardService.setSetting() method.
      Parameters:
      idIO - The ID of the configuration to store.
    • loadConfiguration

      public HashMap<String,com.vaadin.flow.component.Component> loadConfiguration(String idIO)
      Loads the configuration values for a dynamic card.
      Parameters:
      idIO - The ID of the dynamic card.
      Returns:
      A HashMap containing the loaded configuration values.
    • getSourceValue

      public String getSourceValue(String sourceIO)
      Retrieves the source value based on the provided input. If the source value is not found, returns the default value.
      Parameters:
      sourceIO - The input representing the source.
      Returns:
      The source value based on the provided input, or null if the source value is not found.
    • getSourceValue

      public String getSourceValue(String sourceIO, String defaultIO)
      Retrieves the source value based on the provided input. If the source value is not found, returns the default value.
      Parameters:
      sourceIO - The input representing the source.
      defaultIO - The default value to return if the source value is not found.
      Returns:
      The source value based on the provided input, or the default value if the source value is not found.
    • getValue

      public String getValue(String keyIO, String defaultIO)
      Retrieves the value associated with a given key from the cardService.
      Parameters:
      keyIO - The key of the value to retrieve.
      Returns:
      The value associated with the given key, or null if the value is not found.
    • create

      public void create(String idIO)
      Specified by:
      create in interface CardIdListener
    • update

      public void update(Card cardIO)
      Specified by:
      update in interface CardValueListener
    • config

      public HashMap<String,com.vaadin.flow.component.Component> config()
      Specified by:
      config in interface CardConfigListener