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 2018/01/09 13:14:08 UTC

[GitHub] chetanmeh commented on a change in pull request #3162: Add type property to entity documents

chetanmeh commented on a change in pull request #3162: Add type property to entity documents 
URL: https://github.com/apache/incubator-openwhisk/pull/3162#discussion_r160402766
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/WhiskStore.scala
 ##########
 @@ -69,6 +69,14 @@ protected[core] trait WhiskDocument extends DocumentSerializer with DocumentRevi
    */
   protected[core] final def docinfo: DocInfo = DocInfo(docid, rev)
 
+  /**
+   * Determines entity type based on entity class name
+   */
+  protected[core] def documentType: String = {
+    val typeName = this.getClass.getSimpleName.toLowerCase
+    if (typeName.startsWith("whisk")) typeName.substring(5) else typeName
+  }
 
 Review comment:
   Ack. Would work on a new PR

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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