Skip to content

Commit eec2264

Browse files
committed
make get* public in Params
1 parent 4090d95 commit eec2264

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mllib/src/main/scala/org/apache/spark/ml/param/params.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ trait Params extends Identifiable with Serializable {
149149
def explainParams(): String = params.map(explain).mkString("\n")
150150

151151
/** Checks whether a param is explicitly set. */
152-
def isSet(param: Param[_]): Boolean = {
152+
final def isSet(param: Param[_]): Boolean = {
153153
shouldOwn(param)
154154
paramMap.contains(param)
155155
}
156156

157157
/** Checks whether a param is explicitly set or has a default value. */
158-
def isDefined(param: Param[_]): Boolean = {
158+
final def isDefined(param: Param[_]): Boolean = {
159159
shouldOwn(param)
160160
defaultParamMap.contains(param) || paramMap.contains(param)
161161
}
@@ -186,15 +186,15 @@ trait Params extends Identifiable with Serializable {
186186
/**
187187
* Optionally returns the user-supplied value of a param.
188188
*/
189-
protected final def get[T](param: Param[T]): Option[T] = {
189+
final def get[T](param: Param[T]): Option[T] = {
190190
shouldOwn(param)
191191
paramMap.get(param)
192192
}
193193

194194
/**
195195
* Clears the user-supplied value for the input param.
196196
*/
197-
protected final def clear(param: Param[_]): this.type = {
197+
final def clear(param: Param[_]): this.type = {
198198
shouldOwn(param)
199199
paramMap.remove(param)
200200
this
@@ -204,7 +204,7 @@ trait Params extends Identifiable with Serializable {
204204
* Gets the value of a param in the embedded param map or its default value. Throws an exception
205205
* if neither is set.
206206
*/
207-
protected final def getOrDefault[T](param: Param[T]): T = {
207+
final def getOrDefault[T](param: Param[T]): T = {
208208
shouldOwn(param)
209209
get(param).orElse(getDefault(param)).get
210210
}
@@ -231,15 +231,15 @@ trait Params extends Identifiable with Serializable {
231231
/**
232232
* Gets the default value of a parameter.
233233
*/
234-
protected final def getDefault[T](param: Param[T]): Option[T] = {
234+
final def getDefault[T](param: Param[T]): Option[T] = {
235235
shouldOwn(param)
236236
defaultParamMap.get(param)
237237
}
238238

239239
/**
240240
* Tests whether the input param has a default value set.
241241
*/
242-
protected final def hasDefault[T](param: Param[T]): Boolean = {
242+
final def hasDefault[T](param: Param[T]): Boolean = {
243243
shouldOwn(param)
244244
defaultParamMap.contains(param)
245245
}

0 commit comments

Comments
 (0)