Class PredefinedContentHelper


  • public final class PredefinedContentHelper
    extends Object
    A helper class to parse and manage the key-value pairs within a PredefinedContent referenceID string. The referenceID is expected to be in a URL query string format (e.g., key1=value1&key2=value2).
    • Constructor Detail

      • PredefinedContentHelper

        public PredefinedContentHelper​(String referenceId)
        Constructs a helper instance by parsing the provided reference ID.
        Parameters:
        referenceId - The string from PredefinedContent.getReferenceID(), expected to be in URL query string format.
    • Method Detail

      • getTransactionId

        public Optional<String> getTransactionId()
        Gets the transaction ID from the reference ID.
        Returns:
        An Optional containing the TransactionID, or an empty Optional if not present.
      • getTimeStamp

        public Optional<String> getTimeStamp()
        Gets the timestamp from the reference ID.
        Returns:
        An Optional containing the TimeStamp, or an empty Optional if not present.
      • get

        public Optional<String> get​(String key)
        Gets the value for a given key from the reference ID.
        Parameters:
        key - The name of the parameter to retrieve.
        Returns:
        An Optional containing the parameter's value, or an empty Optional if not present.
      • toMap

        public Map<String,​String> toMap()
        Returns an unmodifiable view of all parsed parameters.
        Returns:
        An unmodifiable Map of all key-value pairs from the reference ID.