/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * JavaWorld Library, Copyright 2011 Bryan Chadwick * * * * FILE: ./universe/control/Transfer.java * * * * This file is part of JavaWorld. * * * * JavaWorld 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 * * 3 of the License, or (at your option) any later version. * * * * JavaWorld 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 JavaWorld. If not, see <http://www.gnu.org/licenses/>. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package universe.control; /** Represents a Transfer of some message payload */ public class Transfer extends Message{ private static final long serialVersionUID = 1; private Object message; /** Create a Transfer Message with the given World ID and Payload */ public Transfer(long id, Object m){ super(id); this.message = m; } /** Is this a Transfer Message? */ public boolean isTransfer(){ return true; } /** Return the message's transfered payload... */ @SuppressWarnings("unchecked") public <R> R payload(){ return (R)this.message; } }