1
1
package com .ckkloverdos .env
2
2
3
3
import com .ckkloverdos .key .{TypedKeyWithDefault , TypedKeyOnly }
4
+ import java .util .Date
4
5
5
6
/**
6
7
*
@@ -14,6 +15,67 @@ sealed class EnvHelpers {
14
15
def newTypedKeyWithDefault [A ](name : String , value : A , typ : Class [A ]): TypedKeyWithDefault [A ] = {
15
16
new TypedKeyWithDefault [A ](name, value)((Manifest .classType[A ](typ)))
16
17
}
18
+
19
+ def ByteKey (name : String ): TypedKeyOnly [Byte ] =
20
+ new TypedKeyOnly (name)
21
+
22
+ def ByteKey (name : String , value : Byte ): TypedKeyWithDefault [Byte ] =
23
+ new TypedKeyWithDefault (name, value)
24
+
25
+ def BooleanKey (name : String ): TypedKeyOnly [Boolean ] =
26
+ new TypedKeyOnly (name)
27
+
28
+ def BooleanKey (name : String , value : Boolean ): TypedKeyWithDefault [Boolean ] =
29
+ new TypedKeyWithDefault (name, value)
30
+
31
+ def ShortKey (name : String ): TypedKeyOnly [Short ] =
32
+ new TypedKeyOnly (name)
33
+
34
+ def ShortKey (name : String , value : Short ): TypedKeyWithDefault [Short ] =
35
+ new TypedKeyWithDefault (name, value)
36
+
37
+ def CharKey (name : String ): TypedKeyOnly [Char ] =
38
+ new TypedKeyOnly (name)
39
+
40
+ def CharKey (name : String , value : Char ): TypedKeyWithDefault [Char ] =
41
+ new TypedKeyWithDefault (name, value)
42
+
43
+ def IntKey (name : String ): TypedKeyOnly [Int ] =
44
+ new TypedKeyOnly (name)
45
+
46
+ def IntKey (name : String , value : Int ): TypedKeyWithDefault [Int ] =
47
+ new TypedKeyWithDefault (name, value)
48
+
49
+ def LongKey (name : String ): TypedKeyOnly [Long ] =
50
+ new TypedKeyOnly (name)
51
+
52
+ def LongKey (name : String , value : Long ): TypedKeyWithDefault [Long ] =
53
+ new TypedKeyWithDefault (name, value)
54
+
55
+ def FloatKey (name : String ): TypedKeyOnly [Float ] =
56
+ new TypedKeyOnly (name)
57
+
58
+ def FloatKey (name : String , value : Float ): TypedKeyWithDefault [Float ] =
59
+ new TypedKeyWithDefault (name, value)
60
+
61
+ def DoubleKey (name : String ): TypedKeyOnly [Double ] =
62
+ new TypedKeyOnly (name)
63
+
64
+ def DoubleKey (name : String , value : Double ): TypedKeyWithDefault [Double ] =
65
+ new TypedKeyWithDefault (name, value)
66
+
67
+ def StringKey (name : String ): TypedKeyOnly [String ] =
68
+ new TypedKeyOnly (name)
69
+
70
+ def StringKey (name : String , value : String ): TypedKeyWithDefault [String ] =
71
+ new TypedKeyWithDefault (name, value)
72
+
73
+ def DateKey (name : String ): TypedKeyOnly [Date ] =
74
+ new TypedKeyOnly (name)
75
+
76
+ def DateKey (name : String , value : Date ): TypedKeyWithDefault [Date ] =
77
+ new TypedKeyWithDefault (name, value)
78
+
17
79
}
18
80
19
81
object EnvHelpers extends EnvHelpers
0 commit comments