Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 0ad6e30

Browse files
author
hainguyen
committed
Minor changes
1 parent cdb9e50 commit 0ad6e30

File tree

57 files changed

+122
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+122
-149
lines changed

mycollab-core/src/main/java/com/mycollab/core/MyCollabException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package com.mycollab.core
2323
* @author MyCollab Ltd.
2424
* @since 1.0
2525
*/
26-
class MyCollabException : RuntimeException {
26+
open class MyCollabException : RuntimeException {
2727

2828
constructor(message: String) : super(message) {}
2929

mycollab-core/src/main/java/com/mycollab/core/SecureAccessException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package com.mycollab.core
2020
* @author MyCollab Ltd
2121
* @since 5.1.3
2222
*/
23-
class SecureAccessException : MyCollabException {
23+
open class SecureAccessException : MyCollabException {
2424
constructor() : super("")
2525

2626
constructor(message: String) : super(message) {}

mycollab-core/src/main/java/com/mycollab/core/UserInvalidInputException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package com.mycollab.core
2424
* @author MyCollab Ltd.
2525
* @since 1.0
2626
*/
27-
class UserInvalidInputException : MyCollabException {
27+
open class UserInvalidInputException : MyCollabException {
2828

2929
constructor(message: String) : super(message)
3030

mycollab-core/src/main/java/com/mycollab/core/arguments/ValuedBean.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import java.io.Serializable
2525
* @author MyCollab Ltd.
2626
* @since 1.0
2727
*/
28-
class ValuedBean: Serializable {
28+
open class ValuedBean: Serializable {
2929

3030
@JsonIgnore
3131
@NotBindable

mycollab-dao/src/main/java/com/mycollab/db/arguments/NumberSearchField.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ package com.mycollab.db.arguments
2020
* @author MyCollab Ltd
2121
* @since 6.0.0
2222
*/
23-
class NumberSearchField constructor(operation: String, var value: Int?, var compareOperator: String) : SearchField(operation) {
23+
open class NumberSearchField constructor(operation: String, var value: Int?, var compareOperator: String) : SearchField(operation) {
2424
constructor(value: Int) : this(SearchField.AND, value, NumberSearchField.EQUAL)
2525

2626
constructor(value: Int, compareOperator: String) : this(SearchField.AND, value, compareOperator)
2727

2828
companion object {
29-
@JvmField val EQUAL = "="
30-
@JvmField val NOT_EQUAL = "<>"
31-
@JvmField val LESS_THAN = "<"
32-
@JvmField val GREATER = ">"
29+
const val EQUAL = "="
30+
const val NOT_EQUAL = "<>"
31+
const val LESS_THAN = "<"
32+
const val GREATER = ">"
3333

3434
@JvmStatic fun equal(value: Int) = NumberSearchField(SearchField.AND, value, EQUAL)
3535

mycollab-dao/src/main/java/com/mycollab/db/arguments/SearchField.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import java.io.Serializable
2424
* @author MyCollab Ltd.
2525
* @since 1.0
2626
*/
27-
class SearchField : Serializable {
27+
open class SearchField : Serializable {
2828

2929
var operation = AND
3030

@@ -34,17 +34,13 @@ class SearchField : Serializable {
3434
this.operation = operation
3535
}
3636

37-
override fun toString(): String {
38-
return BeanUtility.printBeanObj(this)
39-
}
37+
override fun toString(): String = BeanUtility.printBeanObj(this)
4038

4139
companion object {
4240
private const val serialVersionUID = 1L
4341

44-
@JvmField
45-
val OR = "OR"
42+
const val OR = "OR"
4643

47-
@JvmField
48-
val AND = "AND"
44+
const val AND = "AND"
4945
}
5046
}

mycollab-dao/src/main/java/com/mycollab/db/arguments/SearchRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ package com.mycollab.db.arguments
2020
* @author MyCollab Ltd
2121
* @since 6.0.0
2222
*/
23-
class SearchRequest(var currentPage: Int, var numberOfItems: Int) {
23+
open class SearchRequest(var currentPage: Int, var numberOfItems: Int) {
2424
companion object {
25-
@JvmField val DEFAULT_NUMBER_SEARCH_ITEMS = 25
25+
const val DEFAULT_NUMBER_SEARCH_ITEMS = 25
2626
}
2727
}

mycollab-dao/src/main/java/com/mycollab/db/query/BooleanParam.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class BooleanParam(id: String, table: String, column: String) : ColumnParam(id,
1616
}
1717

1818
companion object {
19-
@JvmField
20-
val IS = "is"
19+
const val IS = "is"
2120

2221
@JvmField
2322
val OPTIONS = arrayOf(IS)

mycollab-dao/src/main/java/com/mycollab/db/query/ColumnParam.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ package com.mycollab.db.query
2020
* @author MyCollab Ltd.
2121
* @since 4.0
2222
*/
23-
class ColumnParam(id: String, var table: String, var column: String) : Param(id)
23+
open class ColumnParam(id: String, var table: String, var column: String) : Param(id)

mycollab-dao/src/main/java/com/mycollab/security/BooleanPermissionFlag.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@ import com.mycollab.common.i18n.SecurityI18nEnum
2626
*/
2727
class BooleanPermissionFlag : PermissionFlag() {
2828
companion object {
29-
@JvmField val TRUE = 128
29+
const val TRUE = 128
3030

31-
@JvmField val FALSE = 129
31+
const val FALSE = 129
3232

3333
/**
3434
* Check whether `flag` is true permission
3535
*
3636
* @param flag
3737
* @return
3838
*/
39-
fun beTrue(flag: Int?): Boolean = flag == TRUE
39+
fun beTrue(flag: Int?) = flag == TRUE
4040

4141
/**
4242
* Check whether `flag` is false permission
4343
*
4444
* @param flag
4545
* @return
4646
*/
47-
fun beFalse(flag: Int?): Boolean = flag == FALSE
47+
fun beFalse(flag: Int?) = flag == FALSE
4848

49-
fun toKey(flag: Int?): SecurityI18nEnum = if (flag == TRUE) SecurityI18nEnum.YES else SecurityI18nEnum.NO
49+
fun toKey(flag: Int?) = if (flag == TRUE) SecurityI18nEnum.YES else SecurityI18nEnum.NO
5050
}
5151
}

0 commit comments

Comments
 (0)