Cyc2RDBMessage.java from Texai at Krugle
Show Cyc2RDBMessage.java syntax highlighted
/*
* Cyc2RDBMessage.java
*
* Created on October 31, 2006, 1:50 PM
*
* Description: Instances of this serializable message object contain the Cyc2RDB processing command.
*
* Copyright (C) 2006 Stephen L. Reed.
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.texai.kb.ejb.mdb;
import java.io.Serializable;
import javax.persistence.Transient;
/**
*
* @author reed
*/
public final class Cyc2RDBMessage implements Serializable {
/**
* Determines if a de-serialized file is compatible with this class.
*
* Maintainers must change this value if and only if the new version
* of this class is not compatible with old versions. See Sun docs
* for <a href=http://java.sun.com/products/jdk/1.1/docs/guide
* /serialization/spec/version.doc.html> details. </a>
*
* Not necessary to include in first version of the class, but
* included here as a reminder of its importance.
*/
@Transient
private static final long serialVersionUID = 1L;
/** the command */
private final String command; // NOPMD
/** the restart assertion sequence number */
private final int restartAssertionSequenceNbr; // NOPMD
/** the restart microtherory name */
private final String restartMicrotheoryName; // NOPMD
/** Creates a new instance of Cyc2RDBMessage */
public Cyc2RDBMessage(final String command, final int restartAssertionSequenceNbr, final String restartMicrotheoryName) {
super();
//Preconditions
assert command != null : "command must not be null";
assert "start".equals(command) || "stop".equals(command) : "Cyc2RDB processing command must be \"start\" or \"stop\"";
assert restartAssertionSequenceNbr >= 0 : "restartAssertionSequenceNbr must not be negative";
assert restartMicrotheoryName != null : "restartMicrotheoryName must not be null";
this.command = command;
this.restartAssertionSequenceNbr = restartAssertionSequenceNbr;
this.restartMicrotheoryName = restartMicrotheoryName;
}
/** Gets the command
*
* @return the command
*/
public String getCommand() {
return command;
}
/** Gets the restart assertion sequence number
*
* @return the restart assertion sequence number
*/
public int getRestartAssertionSequenceNbr() {
return restartAssertionSequenceNbr;
}
/** Gets the restart microtherory name
*
* @return the restart microtherory name
*/
public String getRestartMicrotheoryName() {
return restartMicrotheoryName;
}
/** Returns a string representation of this object.
*
* @return a string representation of this object
*/
@Override
public String toString() {
return command + ", restart assertion sequence nbr: " + restartAssertionSequenceNbr + ", restart mt: " + restartMicrotheoryName;
}
}
See more files for this project here