Web Issues Query

The WebIssuesQuery class is useful to execute the query to retrieve the web-issues data from the database with the possibility to dynamically filter that query with the CriteriaBuilder's logic

Author

N7ghtm4r3 - Tecknobit

Constructors

Link copied to clipboard
constructor(entityManager: EntityManager, applicationId: String, rawFilters: Set<String>)
Constructor to init the IssuesQuery

Properties

Link copied to clipboard
protected val applicationId: String
applicationId the identifier of the application
Link copied to clipboard
private val BRAND_PATTERN: Pattern
BRAND_PATTERN the pattern to validate the brands values
Link copied to clipboard
private val BRAND_REGEX: String = "^(Pixel|Apple|Samsung|Google|OnePlus|Sony|Motorola|Oppo|Vivo|Nokia|HTC|Asus|Realme|Honor|ZTE|Dell|HP|Lenovo|Acer|Razer|Microsoft|MSI|Toshiba|LG|Huawei|Amazon|Xiaomi|RCA|iMac|Alienware|ASUS ROG|HP Omen|Gigabyte AORUS|Corsair|Lenovo Legion|Dell G Series)$"
BRAND_REGEX regex to validate the brands values
Link copied to clipboard
protected val BROWSER_PATTERN: Pattern
BROWSER_PATTERN the pattern to validate the browsers values
Link copied to clipboard
private val BROWSER_REGEX: String = "^(Google Chrome|Safari|Microsoft Edge|Mozilla Firefox|Opera|Samsung Internet|Brave|Vivaldi|Tor Browser|Epic Privacy Browser|Maxthon)$"
BROWSER_REGEX regex to validate the browsers values
Link copied to clipboard
protected val criteriaBuilder: CriteriaBuilder
criteriaBuilder the builder to add the criteria to filter the query
Link copied to clipboard
private val DATE_PATTERN: Pattern
DATE_PATTERN the pattern to validate the date values
Link copied to clipboard
private val DATE_REGEX: String = "\b(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[0-2])/\d{4}(\s+([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])?\b"
DATE_REGEX regex to validate the date values
Link copied to clipboard
protected val device: Join<T, AmetistaDevice>
device the device related to the issue retrieved with the Join
Link copied to clipboard
protected val entityManager: EntityManager
entityManager manage the entities
Link copied to clipboard
protected val issue: Root<T>
issue the root table
Link copied to clipboard
private val MODEL_PATTERN: Pattern
MODEL_PATTERN the pattern to validate the models values
Link copied to clipboard
private val MODEL_REGEX: String = "^(?!^(Google Chrome|Safari|Microsoft Edge|Mozilla Firefox|Opera|Samsung Internet|Brave|Vivaldi|Tor Browser|Epic Privacy Browser|Maxthon)$)(\d{1,2}[A-Za-z]?[- ]?\d?[A-Za-z]?|[A-Za-z]+[ -]?\d{1,2}([A-Za-z]?|\d*)|[A-Za-z0-9]+[- ]?\d{1,2}|\d{1,2}[- ]?[A-Za-z0-9]+|[A-Za-z0-9]+[ -]?[A-Za-z0-9]+|\d{1,2}[A-Za-z]? ?[A-Za-z]+|\w+ ?[A-Za-z0-9]+)$"
MODEL_REGEX regex to validate the models values
Link copied to clipboard
NAME_PATTERN the pattern to validate the names values
Link copied to clipboard
private val NAME_REGEX: String = "\b(\w+Exception)\b"
NAME_REGEX regex to validate the exception name
Link copied to clipboard
protected val platform: Platform
platformName the name of the platform
Link copied to clipboard
protected val predicates: ArrayList<Predicate>
predicates the list of predicates to apply to the query
Link copied to clipboard
protected val query: CriteriaQuery<T>
query the criteria prepared query to execute
Link copied to clipboard
rawFilters the filters all together in raw format
Link copied to clipboard
private val VERSION_PATTERN: Pattern
VERSION_PATTERN the pattern to validate the versions values
Link copied to clipboard
private val VERSION_REGEX: String = "\b(v?)(\d+(\.\d+)*)([-_]?([a-zA-Z]+[-_]?\d*)?)?\b"
VERSION_REGEX regex to validate the versions values

Functions

Link copied to clipboard
private open fun addBrowserPredicates()
Method to add the browsers filter
Link copied to clipboard
protected open fun extractFiltersByPattern(pattern: Pattern): HashSet<String>
Method to extract from the rawFilters the specific set of filters
Link copied to clipboard
protected open fun fillPredicates()
Wrapper method to fill all the predicates dynamically
Link copied to clipboard
private open fun getBrowserFilters(): HashSet<String>
Method to get from the rawFilters the browsers filter related
Link copied to clipboard
open fun getIssues(): List<T>
open fun getIssues(pageable: Pageable): List<T>
Method to get the issue executing the query
Link copied to clipboard
protected open fun getVersionPredicates(versions: HashSet<String>): ArrayList<Predicate>
Method to get the version predicates dynamically