/******************************************************************* Copyright (c) 2001-2010 Apprisant Technologies Inc. All rights reserved. Apprisant Technologies permits non-exclusive royalty free use, copying and modification of this demo program source code for the purposes of evaluating the Apprisant Toolkit or building applications that use it. This software and documentation is provided "AS IS". APPRISANT TECHNOLOGIES DISCLAIMS ANY REPRESENTATIONS AND WARRANTIES, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS OF THIS PRODUCT FOR ANY PARTICULAR PURPOSE. APPRISANT TECHNOLOGIES SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY ANY PARTY, INCLUDING LOST PROFITS, ARISING FROM THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ITS DERIVATIONS. ********************************************************************/ package project; import apprisant.diagram.env.MapConverter; /* The data object class for the Project demo. Includes two converter classes, for JobType and Status, at the end of this file. */ public class Job { // Data property names static final String JOB_ID = "jobID"; static final String JOB_TYPE = "jobType"; static final String STATUS = "status"; static final String PRIORITY = "priority"; // JOB_TYPE values static enum JobType { INSTALLATION, REPAIR, OVERHAUL } // STATUS values static enum Status { WAITING, READY } // PRIORITY values static enum Priority { HIGH, MEDIUM, LOW } private Integer key; private String id; private JobType type; private Status status; private Priority priority; public Job (int key, String id, JobType type, Status status, Priority priority) { this.key = key; this.id = id; this.type = type; this.status = status; this.priority = priority; } public Integer getKey() { return key; } public String getJobID() { return id; } public JobType getJobType() { return type; } public Status getStatus() { return status; } public Priority getPriority() { return priority; } /** Converter classes to enable Red to display attribute values as text. */ public static class JobTypeConverter extends MapConverter { public JobTypeConverter() { super(JobType.values(), true); } } public static class StatusConverter extends MapConverter { public StatusConverter() { super(Status.values(), true); } } }