package com.aemreunal.domain;

/*
 ***************************
 * Copyright (c) 2014      *
 *                         *
 * This code belongs to:   *
 *                         *
 * @author Ahmet Emre Ünal *
 * S001974                 *
 *                         *
 * aemreunal@gmail.com     *
 * emre.unal@ozu.edu.tr    *
 *                         *
 * aemreunal.com           *
 ***************************
 */

import java.util.Date;

public class BeaconBuilder {
    private Beacon beacon;

    public BeaconBuilder() {
        this.beacon = new Beacon();
    }

    public BeaconBuilder withBeaconId(Long beaconId) {
        this.beacon.setBeaconId(beaconId);
        return this;
    }

    public BeaconBuilder withUuid(String uuid) {
        this.beacon.setUuid(uuid.toUpperCase());
        return this;
    }

    public BeaconBuilder withMajor(String major) {
        this.beacon.setMajor(major.toUpperCase());
        return this;
    }

    public BeaconBuilder withMinor(String minor) {
        this.beacon.setMinor(minor.toUpperCase());
        return this;
    }

    public BeaconBuilder withDescription(String description) {
        this.beacon.setDescription(description);
        return this;
    }

    public BeaconBuilder withGroup(BeaconGroup group) {
        this.beacon.setGroup(group);
        return this;
    }

    public BeaconBuilder withProject(Project project) {
        this.beacon.setProject(project);
        return this;
    }

    public BeaconBuilder withCreationDate(Date creationDate) {
        this.beacon.setCreationDate(creationDate);
        return this;
    }

    public Beacon build() {
        return this.beacon;
    }
}

@@ -431,16 +431,46 @@
 il.Date;
+%0Aimport javax.json.JsonObject;
 %0A%0Apublic
@@ -1624,32 +1624,422 @@
 rn this;%0A    %7D%0A%0A
+    public BeaconBuilder withJson(JsonObject beaconJson) %7B%0A        this.beacon.setUuid(beaconJson.getString(%22uuid%22));%0A        this.beacon.setMajor(beaconJson.getString(%22major%22));%0A        this.beacon.setMinor(beaconJson.getString(%22minor%22));%0A        this.beacon.setDescription(beaconJson.getString(%22description%22));%0A        this.beacon.setCreationDate(new Date());%0A        return this;%0A    %7D%0A%0A
     public Beaco

Add beacon object building from JSON