/*
 * The MIT License
 *
 * Copyright 2015 Rene Gielen (rene.gielen@gmail.com).
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package net.rgielen.actionframeworks.domain;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * Actor domain object.
 *
 * @author Rene Gielen
 */
public class Actor {

    private String id;
    @NotNull @Size(min = 2)
    private String firstname;
    @NotNull @Size(min = 2)
    private String lastname;
    private Integer rank;
    private boolean cool;
    private Date birthday;
    private float salary;

    public Actor() {
    }

    public Actor(String firstname, String lastname) {
        this.firstname = firstname;
        this.lastname = lastname;
    }

    public Actor(String id, String firstname, String lastname) {
        this.id = id;
        this.firstname = firstname;
        this.lastname = lastname;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public Integer getRank() {
        return rank;
    }

    public void setRank(Integer rank) {
        this.rank = rank;
    }

    public boolean isCool() {
        return cool;
    }

    public void setCool(boolean cool) {
        this.cool = cool;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public float getSalary() {
        return salary;
    }

    public void setSalary(float salary) {
        this.salary = salary;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Actor)) return false;

        Actor actor = (Actor) o;

        return !(id != null ? !id.equals(actor.id) : actor.id != null);

    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}

@@ -1285,16 +1285,46 @@
 s.Size;%0A
+import javax.ws.rs.FormParam;%0A
 import j
@@ -1419,16 +1419,37 @@
 ctor %7B%0A%0A
+    @FormParam(%22id%22)%0A
     priv
@@ -1459,24 +1459,25 @@
  String id;%0A
+%0A
     @NotNull
@@ -1484,32 +1484,60 @@
  @Size(min = 2)%0A
+    @FormParam(%22firstname%22)%0A
     private Stri
@@ -1546,24 +1546,25 @@
  firstname;%0A
+%0A
     @NotNull
@@ -1575,24 +1575,51 @@
 ze(min = 2)%0A
+    @FormParam(%22lastname%22)%0A
     private 
@@ -1639,33 +1639,31 @@
 me;%0A
+%0A
     
-private Integer rank;
+@FormParam(%22cool%22)
 %0A   
@@ -1680,24 +1680,51 @@
 oolean cool;
+%0A%0A    private Integer rank;
 %0A    private
@@ -1751,17 +1751,17 @@
 private 
-f
+F
 loat sal
@@ -1763,16 +1763,21 @@
 t salary
+ = 0f
 ;%0A%0A    p
@@ -2950,17 +2950,17 @@
  public 
-f
+F
 loat get
@@ -3026,17 +3026,17 @@
 tSalary(
-f
+F
 loat sal

switch back from primitive type