Package velox.api.layer1.agreement
Class AgreementInfo
java.lang.Object
velox.api.layer1.agreement.AgreementInfo
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for constructingAgreementInfoinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringOptional custom text for the accept button.final List<AgreementComponent> Additional UI components displayed in the agreement dialog below the agreement text and above the accept/decline buttons (e.g.final StringUnique identifier of agreement.final StringMain content text of the agreement.final StringTitle of the agreement, displayed as the dialog title in the agreement dialog.final StringOptional custom text for the decline button.Optional confirmation callback invoked when the user clicks the decline button.final LocalDateExpiration date of the agreement. -
Method Summary
Modifier and TypeMethodDescriptionCreates a newAgreementInfo.Builderpre-populated with the values from thisAgreementInfoinstance.
-
Field Details
-
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
Title of the agreement, displayed as the dialog title in the agreement dialog. -
agreementText
Main content text of the agreement. Can be in plain HTML format (only tags supported byJEditorPaneshould be used). -
acceptButtonText
Optional custom text for the accept button. Ifnullor empty, the default value "Accept" is used. -
declineButtonText
Optional custom text for the decline button. Ifnullor empty, the default value "Decline" is used. -
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
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
Optional confirmation callback invoked when the user clicks the decline button.- See Also:
-
-
Method Details
-
toBuilder
Creates a newAgreementInfo.Builderpre-populated with the values from thisAgreementInfoinstance.- Returns:
- a new builder initialized with this agreement's data
-