Class AgreementInfo

java.lang.Object
velox.api.layer1.agreement.AgreementInfo

public class AgreementInfo extends Object
Class representing information about agreement to be shown to user. It is used as a parameter in AgreementHelper.requestAgreement(AgreementInfo, AgreementAcceptanceCallback) method. It contains agreement id, title, main text, optional accept/decline button texts and optional additional components to be shown in agreement dialog (e.g. radio buttons). All fields are required except additional components, declineConfirmation, and accept/decline button texts, which are optional and will have default values if not set (default value for accept button text is "Accept", for decline button text is "Decline"). Agreement id should be unique for each agreement and can be used to identify agreement in callback. Agreement title is shown in agreement dialog as a dialog title. Agreement text is the main content of agreement and can be in a plain HTML format (e.g. use only the tags supported by JEditorPane). Additional components are shown below agreement text and above accept/decline buttons.
  • Field Details

    • agreementId

      public final String agreementId
      Unique identifier of agreement. Used to store agreement acceptance data in the database. Should be unique for different agreements and their versions. If agreement with the same id is already accepted, it will be considered as already accepted and callback will be called with AgreementStatus.ALREADY_ACCEPTED status. To form agreement id, use adapter or add-on name concatenated with agreement id (unique within given adapter or add-on) and version (if needed). For example, "EXT:com.bookmap.SomeAdapter#PrivacyPolicy-v1".
    • agreementTitle

      public final String agreementTitle
      Title of the agreement, displayed as the dialog title in the agreement dialog.
    • agreementText

      public final String agreementText
      Main content text of the agreement. Can be in plain HTML format (only tags supported by JEditorPane should be used).
    • acceptButtonText

      public final String acceptButtonText
      Optional custom text for the accept button. If null or empty, the default value "Accept" is used.
    • declineButtonText

      public final String declineButtonText
      Optional custom text for the decline button. If null or empty, the default value "Decline" is used.
    • expirationDate

      public final LocalDate expirationDate
      Expiration date of the agreement. If a previously accepted agreement has an expiration date in the past, it is considered expired and the user will be prompted to accept it again.
    • agreementComponents

      public final List<AgreementComponent> agreementComponents
      Additional UI components displayed in the agreement dialog below the agreement text and above the accept/decline buttons (e.g. radio button groups). May be empty if no additional components are needed.
      See Also:
    • declineConfirmation

      public final AgreementDeclineConfirmationCallback declineConfirmation
      Optional confirmation callback invoked when the user clicks the decline button.
      See Also:
  • Method Details

    • toBuilder

      public AgreementInfo.Builder toBuilder()
      Creates a new AgreementInfo.Builder pre-populated with the values from this AgreementInfo instance.
      Returns:
      a new builder initialized with this agreement's data