Skip to content

Instantly share code, notes, and snippets.

@jamalsa
Last active December 17, 2015 20:29

Revisions

  1. jamalsa revised this gist May 29, 2013. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions NewCommonMessage.java
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,14 @@ public void setIdpel(String idpel) {
    }
    }

    // Contoh Inheritance
    @Entity(fieldOrder={"switcherId", "kodeArea", "idpel"})
    class TestObject2 extends TestObject1
    {
    @Element(length=7)
    public String kodeArea;
    }

    ObjectParser tParser = new ObjectParser();
    TestObject tObject = new TestObject();
    tObject.switcherId = "VI105V3";
  2. jamalsa revised this gist May 29, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion NewCommonMessage.java
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ class TestObject
    @Element(length=7)
    public String switcherId;

    @Element(length=15, padding=AdditionalDataPad.LEFT, paddingChar=' ')
    @Element(length=15, padding=AdditionalFieldPadLocation.LEFT, paddingChar='0')
    protected String idpel;

    public String getIdpel() {
  3. jamalsa revised this gist May 29, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion NewCommonMessage.java
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ class TestObject
    @Element(length=7)
    public String switcherId;

    @Element(length=15)
    @Element(length=15, padding=AdditionalDataPad.LEFT, paddingChar=' ')
    protected String idpel;

    public String getIdpel() {
  4. jamalsa revised this gist May 29, 2013. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion NewCommonMessage.java
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,10 @@ public String getIdpel() {
    public void setIdpel(String idpel) {
    this.idpel = idpel;
    }
    }
    }

    ObjectParser tParser = new ObjectParser();
    TestObject tObject = new TestObject();
    tObject.switcherId = "VI105V3";
    tObject.setIdpel("5300000001");
    System.out.println("Parsed object:" + tParser.parseObject(tObject)); // Menampilkan "VI105V3 5300000001"
  5. jamalsa created this gist May 29, 2013.
    17 changes: 17 additions & 0 deletions NewCommonMessage.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    @Entity(fieldOrder={"switcherId", "idpel"})
    class TestObject
    {
    @Element(length=7)
    public String switcherId;

    @Element(length=15)
    protected String idpel;

    public String getIdpel() {
    return idpel;
    }

    public void setIdpel(String idpel) {
    this.idpel = idpel;
    }
    }