/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inport; import java.util.OptionalInt; /** * * @author topazh_ag */ public class MovingObject { private int id; private String name; private OptionalInt type; /** * Get the value of name * * @return the value of name */ public String getName() { return name; } /** * Set the value of name * * @param name new value of name */ public void setName(String name) { this.name = name; } /** * Get the value of id * * @return the value of id */ public int getId() { return id; } /** * Set the value of id * * @param id new value of id */ public void setId(int id) { this.id = id; } public OptionalInt getType() { return type; } public void setType(OptionalInt type) { this.type = type; } public MovingObject(int id, String name) { this.id = id; this.name = name; this.type = OptionalInt.empty(); } public MovingObject(int id, String name, int typeId) { this.id = id; this.name = name; this.type = OptionalInt.of(typeId); } public MovingObject() { type = OptionalInt.empty(); } public MovingObject(String s) { String[] tokens = s.split(";"); id = Integer.parseInt(tokens[0].trim()); name = tokens[1].trim(); type = OptionalInt.empty(); } }