/* * 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 LoadingEquipment extends MovingObject{ public LoadingEquipment() { super(); } public LoadingEquipment(int id, String name) { super(id, name); } @Override public String toString() { String res = getId() + "; " + getName(); if (getType().isPresent()) { res += "; " + getType().getAsInt(); } return res; } public LoadingEquipment(String s) { super(s); String[] tokens = s.split(";"); if (tokens.length >= 3) { setType(OptionalInt.of(Integer.parseInt(tokens[2].trim()))); } } }