View Javadoc
1   package com.github.celldynamics.quimp.filesystem.versions;
2   
3   import com.github.celldynamics.quimp.QuimpException;
4   import com.github.celldynamics.quimp.Serializer;
5   import com.github.celldynamics.quimp.filesystem.IQuimpSerialize;
6   
7   /**
8    * This interface provides method that is run on loaded class reference when current tool version is
9    * higher than version of loaded object.
10   * 
11   * <p>Class implementing this object should extends {@link IQuimpSerialize}
12   * 
13   * @author p.baniukiewicz
14   * @param <T> Type of serialised object
15   * @see Serializer
16   */
17  public interface IQconfOlderConverter<T extends IQuimpSerialize> {
18  
19    /**
20     * This method is run when deserialised class is in version lower that version of loader.
21     * 
22     * @param localref reference to loaded object
23     * @throws QuimpException on problems with conversion
24     */
25    public void upgradeFromOld(Serializer<T> localref) throws QuimpException;
26  
27    /**
28     * Threshold to execture converter.
29     * 
30     * <p>Converter is executed if version returned by this method is lower than that provided in
31     * {@link Serializer#Serializer(IQuimpSerialize, com.github.celldynamics.quimp.QuimpVersion)}
32     * constructor.
33     * 
34     * @return Version for which this Converter. Format returned: a.bc if version string equals
35     *         a.b.c-xxx.
36     */
37    public Double executeForLowerThan();
38  
39  }