Package com.pspdfkit.signatures.storage
Class DatabaseSignatureStorage
-
- All Implemented Interfaces:
-
com.pspdfkit.signatures.storage.SignatureStorage
public class DatabaseSignatureStorage implements SignatureStorage
Our default SignatureStorage implementation that uses the SQLite database to store signatures.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
SIGNATURE_DB_NAME
-
Method Summary
Modifier and Type Method Description static DatabaseSignatureStorage
withName(@NonNull() Context context, @NonNull() String databaseName)
Creates a new DatabaseSignatureStorage
with provided database name.void
addSignature(@NonNull() Signature signature)
Adds the given signature to the signature storage. void
addSignatures(@NonNull() List<Signature> signatures)
Adds the given signatures to the signature storage. void
removeSignature(@NonNull() Signature signature)
Removes the given signature from the signature storage. void
removeSignatures(@NonNull() List<Signature> signatures)
Removes the given signatures from the signature storage. List<Signature>
getSignatures()
Gets the currently stored signatures. void
clear()
Clear all the entries from the database. void
deleteDatabase(@NonNull() Context context)
Deletes the database used by this signature storage. -
-
Method Detail
-
withName
static DatabaseSignatureStorage withName(@NonNull() Context context, @NonNull() String databaseName)
Creates a new
DatabaseSignatureStorage
with provided database name.- Parameters:
context
- Context of the calling component.databaseName
- Database name to use for this storage.- Returns:
A signature storage using SQLite database with the provided name.
-
addSignature
void addSignature(@NonNull() Signature signature)
Adds the given signature to the signature storage.
- Parameters:
signature
- Signature to add.
-
addSignatures
void addSignatures(@NonNull() List<Signature> signatures)
Adds the given signatures to the signature storage.
- Parameters:
signatures
- List of signatures to add.
-
removeSignature
void removeSignature(@NonNull() Signature signature)
Removes the given signature from the signature storage.
- Parameters:
signature
- Signature to remove.
-
removeSignatures
void removeSignatures(@NonNull() List<Signature> signatures)
Removes the given signatures from the signature storage.
- Parameters:
signatures
- List of signatures to remove.
-
getSignatures
@NonNull() List<Signature> getSignatures()
Gets the currently stored signatures.
- Returns:
List of signatures currently in the storage.
-
clear
void clear()
Clear all the entries from the database.
-
deleteDatabase
void deleteDatabase(@NonNull() Context context)
Deletes the database used by this signature storage.
- Parameters:
context
- Context used to access the database.
-
-
-
-