1
1
package com.eldhopj.kotlin_extensions.utils.formatter
2
2
3
3
import java.util.Date
4
+ import org.jetbrains.annotations.NotNull
4
5
5
6
internal interface Formatter {
6
7
@@ -10,15 +11,15 @@ internal interface Formatter {
10
11
* @param date {@link Date} object
11
12
* @param pattern Pattern to format(e.g, yyyy-MM-dd)
12
13
*/
13
- fun format (date : Date , pattern : String ): String
14
+ fun format (@NotNull date : Date ? , @NotNull pattern : String ): String
14
15
15
16
/* *
16
17
* Formats the given date object to the specified pattern
17
18
*
18
19
* @param date string date value
19
20
* @param pattern Pattern to which the date follows(e.g, yyyy-MM-dd)
20
21
*/
21
- fun format (date : String , pattern : String ): Date ?
22
+ fun format (@NotNull date : String , @NotNull pattern : String ): Date ?
22
23
23
24
/* *
24
25
* Formats the given date object to the specified pattern
@@ -27,6 +28,10 @@ internal interface Formatter {
27
28
* @param fromPattern Pattern to which the date follows(e.g, yyyy-MM-dd)
28
29
* @param toPattern Pattern to format(e.g, yyyy-MM-dd)
29
30
*/
30
- fun format (date : String , fromPattern : String , toPattern : String ): String
31
+ fun format (
32
+ @NotNull date : String ,
33
+ @NotNull fromPattern : String ,
34
+ @NotNull toPattern : String
35
+ ): String
31
36
32
37
}
0 commit comments