package vietnamworks.com.vnwcore.entities;

import R.helper.BaseEntity;

/**
 * Created by duynk on 1/7/16.
 */
public class Job extends BaseEntity {

    public enum JobField implements BaseEntity.EntityField {
        JOB_ID("job_id"),
        JOB_TITLE("job_title"),
        JOB_COMPANY("job_company"),
        POSTED_DATE("posted_date"),
        JOB_LOCATION("job_location"),
        JOB_INDUSTRY("job_industry"),
        JOB_DETAIL_URL("job_detail_url"),
        JOB_LOGO_URL("job_logo_url"),
        JOB_VIDEO_URL("job_video_url"),
        SALARY_MIN("salary_min"),
        SALARY_MAX("salary_max"),
        SKILLS("skills"),
        BENEFITS("benefits"),
        VIEWS("views"),
        APPLIED("applied")
        ;

        private final String name;
        private JobField(String s) {
            name = s;
        }

        @Override public boolean equals(String otherName) {
            return otherName!=null && otherName.equals(this.name);
        }

        @Override public String toString() {
            return this.name;
        }
    }

    public Job() {
        super(JobField.values());
    }

    public void setJobTitle(String value) {
        set(JobField.JOB_TITLE, value);
    }

    public String getJobTitle() {
        return getString(JobField.JOB_TITLE, "");
    }

    public String getCompany() {
        return getString(JobField.JOB_COMPANY, "");
    }
}

@@ -64,16 +64,45 @@
 eEntity;
+%0Aimport R.helper.EntityField;
 %0A%0A/**%0A *
@@ -176,338 +176,384 @@
 y %7B%0A
-%0A
     
-public enum JobField implements BaseEntity.EntityField %7B%0A        JOB_ID(%22job_id%22),%0A        JOB_TITLE(%22job_title%22),%0A        JOB_COMPANY(%22job_company%22),%0A        POSTED_DATE(%22posted_date%22),%0A        JOB_LOCATION(%22job_location%22),%0A        JOB_INDUSTRY(%22job_industry%22),%0A        JOB_DETAIL_URL(%22job_detail_url%22),%0A        JOB_LOGO_URL
+@EntityField(%22job_id%22) String JOB_ID;%0A    @EntityField(%22job_title%22) String JOB_TITLE;%0A    @EntityField(%22job_company%22) String JOB_COMPANY;%0A    @EntityField(%22posted_date%22) String POSTED_DATE;%0A    @EntityField(%22job_location%22) String JOB_LOCATION;%0A    @EntityField(%22job_industry%22) String JOB_INDUSTRY;%0A    @EntityField(%22job_detail_url%22) String JOB_DETAIL_URL;%0A    @EntityField
 (%22jo
@@ -568,569 +568,357 @@
 rl%22)
-,%0A       
+ String
  JOB_
-VIDE
+LOG
 O_URL
-(%22job_video_url%22),%0A        SALARY_MIN(%22salary_min%22),%0A        SALARY_MAX(%22salary_max%22),%0A        SKILLS(%22skills%22),%0A        BENEFITS(%22benefits%22),%0A        VIEWS(%22views%22),%0A        APPLIED(%22applied%22)%0A        ;%0A%0A        private final String name;%0A        private JobField(String s) %7B%0A            name = s;%0A        %7D%0A%0A        @Override public boolean equals(String otherName) %7B%0A            return otherName!=null && otherName.equals(this.name);%0A        %7D%0A%0A        @Override public String toString() %7B%0A            return this.name;%0A        %7D%0A    %7D
+;%0A    @EntityField(%22job_video_url%22) String JOB_VIDEO_URL;%0A    @EntityField(%22salary_min%22) String SALARY_MIN;%0A    @EntityField(%22salary_max%22) String SALARY_MAX;%0A    @EntityField(%22skills%22) String SKILLS;%0A    @EntityField(%22benefits%22) String BENEFITS;%0A    @EntityField(%22views%22) String VIEWS;%0A    @EntityField(%22applied%22) String APPLIED;
 %0A%0A  
@@ -952,25 +952,8 @@
 per(
-JobField.values()
 );%0A 
@@ -1014,25 +1014,16 @@
     set(
-JobField.
 JOB_TITL
@@ -1095,33 +1095,24 @@
 n getString(
-JobField.
 JOB_TITLE, %22
@@ -1184,17 +1184,8 @@
 ing(
-JobField.
 JOB_

use runtime annotation for declare field name