You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/08/22 12:43:06 UTC

[GitHub] [openwhisk] rabbah commented on a change in pull request #4559: Allow parameters to be designated as init time properties

rabbah commented on a change in pull request #4559: Allow parameters to be designated as init time properties
URL: https://github.com/apache/openwhisk/pull/4559#discussion_r316655761
 
 

 ##########
 File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/Parameter.scala
 ##########
 @@ -144,19 +151,19 @@ protected[entity] class ParameterName protected[entity] (val name: String) exten
  * be undefined, such as when an action is created but the parameter value is not bound yet.
  * In general, this is an opaque value.
  *
- * It is a value type (hence == is .equals, immutable and cannot be assigned null).
  * The constructor is private so that argument requirements are checked and normalized
  * before creating a new instance.
  *
- * @param value the value of the parameter, may be null
+ * @param v the value of the parameter, may be null
+ * @param init if true, this parameter value is only offered to the action during initialization
  */
-protected[entity] class ParameterValue protected[entity] (private val v: JsValue) extends AnyVal {
+protected[entity] case class ParameterValue protected[entity] (private val v: JsValue, val init: Boolean) {
 
 Review comment:
   logically yes, but there are several operation on parameter names which cons new instances, so i'd have to override equals method (to permit for example removal of a parameter from a map regardless of its init setting); thus attaching the bit on the value treats the setting more opaquely. 
   
   if we reorganize the parameters and annotations to a proper dictionary, we can clean up this whole implementation at some point in the future.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services