CanScan
Loading...
Searching...
No Matches
fr.softsf.canscan.service.DataBuilderService Enum Reference

Service for generating QR code content and default filenames. More...

+ Collaboration diagram for fr.softsf.canscan.service.DataBuilderService:

Public Member Functions

EncodedData buildData (Mode mode, WholeFields input)
 Builds the QR content and default filename based on the selected mode.
 
String buildMecard (String name, String tel, String email, String org, String adr, String url)
 Builds a MECARD-formatted string from the provided contact fields.
 
String buildMeet (String meetTitle, String meetUId, String meetBeginDateTime, String meetEndDateTime, String meetName, String meetLat, String meetLong)
 Builds an iCalendar (VCALENDAR) formatted string representing a meeting (VEVENT).
 

Public Attributes

 INSTANCE
 

Private Member Functions

void appendFieldWithSpecifiedSeparator (StringBuilder sb, String fieldName, String value, String separator)
 Appends a MECARD field in the format fieldName:value<separator> if the value is non-blank.
 

Static Private Attributes

static final String APPEND_FIELD_WITH_SPECIFIED_SEPARATOR
 

Detailed Description

Service for generating QR code content and default filenames.

Supports MECARD MEET FREE modes with input validation and standardized formatting. Returns structured results for encoding and export.

Member Function Documentation

◆ appendFieldWithSpecifiedSeparator()

void fr.softsf.canscan.service.DataBuilderService.appendFieldWithSpecifiedSeparator ( StringBuilder sb,
String fieldName,
String value,
String separator )
private

Appends a MECARD field in the format fieldName:value<separator> if the value is non-blank.

If sb or fieldName is null, or if value is blank, the method does nothing.

Parameters
sbthe target StringBuilder
fieldNamethe MECARD field name (e.g., "N", "TEL")
valuethe field value to append; ignored if blank
separatorthe separator to append after the field (e.g., ";", or System#lineSeparator())

◆ buildData()

EncodedData fr.softsf.canscan.service.DataBuilderService.buildData ( Mode mode,
WholeFields input )

Builds the QR content and default filename based on the selected mode.

Returns null if mode or input is null.

Parameters
modethe QR encoding mode (MECARD or MEET or FREE)
inputthe structured input data
Returns
a EncodedData containing the encoded content and default filename, or
null
if input is invalid
+ Here is the call graph for this function:

◆ buildMecard()

String fr.softsf.canscan.service.DataBuilderService.buildMecard ( String name,
String tel,
String email,
String org,
String adr,
String url )

Builds a MECARD-formatted string from the provided contact fields.

Any blank or null fields are skipped. Returns a valid MECARD string or an empty string if all fields are blank.

Parameters
namefull name
teltelephone number
emailemail address
orgorganization or company
adrpostal address
urlwebsite or profile URL
Returns
a MECARD string representing the contact information, or empty if all fields are blank
+ Here is the call graph for this function:

◆ buildMeet()

String fr.softsf.canscan.service.DataBuilderService.buildMeet ( String meetTitle,
String meetUId,
String meetBeginDateTime,
String meetEndDateTime,
String meetName,
String meetLat,
String meetLong )

Builds an iCalendar (VCALENDAR) formatted string representing a meeting (VEVENT).

Skips blank or null fields. Returns an empty string if all required fields are blank. Latitude and longitude are optional; if provided, they are included in the GEO and LOCATION fields.

Parameters
meetTitlethe meeting title (SUMMARY)
meetUIdthe unique meeting identifier (UID)
meetBeginDateTimethe meeting start date/time (DTSTART)
meetEndDateTimethe meeting end date/time (DTEND)
meetNamethe organizer name (ORGANIZER); optional
meetLatthe meeting latitude; optional
meetLongthe meeting longitude; optional
Returns
an iCalendar (VCALENDAR) string representing the meeting, or empty if all fields are blank
+ Here is the call graph for this function:

Member Data Documentation

◆ APPEND_FIELD_WITH_SPECIFIED_SEPARATOR

final String fr.softsf.canscan.service.DataBuilderService.APPEND_FIELD_WITH_SPECIFIED_SEPARATOR
staticprivate
Initial value:
=
"appendFieldWithSpecifiedSeparator"

◆ INSTANCE

fr.softsf.canscan.service.DataBuilderService.INSTANCE

The documentation for this enum was generated from the following file: