package com.sometrik.framework;

public class Message {
  
  private int elementId = 0;
  private int parentElementId = 0;
  private String textValue = "";
  private String textValue2 = "";
  private MessageType message;
  private String key;
  
  public enum MessageType{
    SHOW_VIEW,
    CREATE_FORMVIEW,
    CREATE_BUTTON,
    CREATE_PICKER, // called Spinner in Android
    CREATE_LINEAR_LAYOUT,
    CREATE_OPENGL_VIEW,
    CREATE_TEXTFIELD,
    CREATE_TEXTLABEL,
    CREATE_DIALOG, //For future
    CREATE_CANVAS,
    SHOW_MESSAGE_DIALOG,
    SHOW_INPUT_DIALOG,
    LAUNCH_BROWSER,
    POST_NOTIFICATION,
    SET_VALUE, //Sets value of textfields.
    SET_LABEL, //this sets label for buttons and labels.
    SET_ATTRIBUTE,
    SET_CAPTION,
    ADD_OPTION,
    QUIT_APP,

    // In-app purchases
    LIST_PRODUCTS,
    BUY_PRODUCT,
    LIST_PURCHASES,
    CONSUME_PURCHASE
  }
  
  Message(MessageType message, String textValue){
    this.message = message;
    this.textValue = textValue;
  }
  Message(MessageType message, int elementId, int parentElementId){
    this.message = message;
    this.elementId = elementId;
    this.parentElementId = parentElementId;
  }
  Message(MessageType message, String textValue, String textValue2){
    this.message = message;
    this.textValue = textValue;
    this.textValue2 = textValue2;
  }
  
  public String getKey() {
    return key;
  }
  public void setKey(String key) {
    this.key = key;
  }
  public int getElementId() {
    return elementId;
  }
  public int getParentElementId() {
    return parentElementId;
  }
  public String getTextValue() {
    return textValue;
  }
  public String getTextValue2() {
    return textValue2;
  }
  public MessageType getMessage() {
    return message;
  }
}

@@ -955,139 +955,169 @@
 ge, 
-String textValue)%7B%0D%0A    this.message = message;%0D%0A    this.textValue = textValue;%0D%0A  %7D%0D%0A  Message(MessageType message, int e
+int elementId, int parentElementId, String textValue, String textValue2)%7B%0D%0A    this.message = message;%0D%0A    this.elementId = elementId;%0D%0A    this.parentE
 lementId
 , in
@@ -1104,37 +1104,34 @@
 .parentElementId
-, int
+ =
  parentElementId
@@ -1130,18 +1130,17 @@
 lementId
-)%7B
+;
 %0D%0A    th
@@ -1146,85 +1146,114 @@
 his.
-message = message;%0D%0A    this.elementId = elementId;%0D%0A    this.parentE
+textValue = textValue;%0D%0A    this.textValue2 = textValue2;%0D%0A  %7D%0D%0A  Message(int messageTypeId, int e
 lementId
  = p
@@ -1240,34 +1240,37 @@
 d, int elementId
- =
+, int
  parentElementId
@@ -1273,45 +1273,8 @@
 ntId
-;%0D%0A  %7D%0D%0A  Message(MessageType message
 , St
@@ -1314,38 +1314,139 @@
 )%7B%0D%0A    
-this.message = message
+message = MessageType.values()%5BmessageTypeId%5D;%0D%0A    this.elementId = elementId;%0D%0A    this.parentElementId = parentElementId
 ;%0D%0A    t

Add constructor overload