Class DynamicCard
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfig()voidgetCard()Retrieves a clone of the Card object associated with this instance.getSourceValue(String sourceIO) Retrieves the source value based on the provided input.getSourceValue(String sourceIO, String defaultIO) Retrieves the source value based on the provided input.Retrieves the value associated with a given key from the cardService.loadConfiguration(String idIO) Loads the configuration values for a dynamic card.voidSets the card object for this instance and updates its associated ID to the fully qualified class name of the provided card.voidstoreConfiguration(String idIO) Stores the configuration values for the dynamic card.void
-
Constructor Details
-
DynamicCard
public DynamicCard()
-
-
Method Details
-
setCard
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
Retrieves a clone of the Card object associated with this instance.- Returns:
- A clone of the Card object.
-
storeConfiguration
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
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
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
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
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
- Specified by:
createin interfaceCardIdListener
-
update
- Specified by:
updatein interfaceCardValueListener
-
config
- Specified by:
configin interfaceCardConfigListener
-