All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rinde.sim.core.model.AbstractModel Maven / Gradle / Ivy

There is a newer version: 4.4.6
Show newest version
package rinde.sim.core.model;

import com.google.common.reflect.TypeToken;

/**
 * Basic implementation that provides a getSupportedType method implementation.
 * @author Bartosz Michalik 
 * 
 * @param  The type that is supported by this model.
 */
public abstract class AbstractModel implements Model {

  private final Class clazz;

  /**
   * Create a new model.
   */
  @SuppressWarnings({ "serial", "unchecked" })
  protected AbstractModel() {
    this.clazz = (Class) new TypeToken(getClass()) {}.getRawType();
  }

  @Override
  public final Class getSupportedType() {
    return clazz;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy