oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexFormatVersion.java [27:72]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public enum IndexFormatVersion {
    /**
     * Index confirming to Oak version upto 1.0.8
     */
    V1(1),
    /**
     * Index confirming to Oak version upto 1.0.9
     */
    V2(2);

    private final int version;

    IndexFormatVersion(int version) {
        this.version = version;
    }

    /**
     * Returns <code>true</code> if this version is at least as high as the
     * given <code>version</code>.
     *
     * @param version the other version to compare.
     * @return <code>true</code> if this version is at least as high as the
     *         provided; <code>false</code> otherwise.
     */
    public boolean isAtLeast(IndexFormatVersion version) {
        return this.version >= version.getVersion();
    }

    public int getVersion() {
        return version;
    }

    public static IndexFormatVersion getVersion(int version) {
        switch(version){
            case 1 : return V1;
            case 2 : return V2;
            default : throw new IllegalArgumentException("Unknown version : " + version);
        }
    }

    public static IndexFormatVersion getDefault(){
        return V2;
    }

    public static IndexFormatVersion max(IndexFormatVersion o1, IndexFormatVersion o2){
        return o1.version > o2.version ? o1 : o2;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexFormatVersion.java [27:72]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public enum IndexFormatVersion {
    /**
     * Index confirming to Oak version upto 1.0.8
     */
    V1(1),
    /**
     * Index confirming to Oak version upto 1.0.9
     */
    V2(2);

    private final int version;

    IndexFormatVersion(int version) {
        this.version = version;
    }

    /**
     * Returns <code>true</code> if this version is at least as high as the
     * given <code>version</code>.
     *
     * @param version the other version to compare.
     * @return <code>true</code> if this version is at least as high as the
     *         provided; <code>false</code> otherwise.
     */
    public boolean isAtLeast(IndexFormatVersion version) {
        return this.version >= version.getVersion();
    }

    public int getVersion() {
        return version;
    }

    public static IndexFormatVersion getVersion(int version) {
        switch(version){
            case 1 : return V1;
            case 2 : return V2;
            default : throw new IllegalArgumentException("Unknown version : " + version);
        }
    }

    public static IndexFormatVersion getDefault(){
        return V2;
    }

    public static IndexFormatVersion max(IndexFormatVersion o1, IndexFormatVersion o2){
        return o1.version > o2.version ? o1 : o2;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



