-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOptionalFeatures.java
More file actions
35 lines (28 loc) · 1.02 KB
/
OptionalFeatures.java
File metadata and controls
35 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.utplsql.api.compatibility;
import org.utplsql.api.Version;
import org.utplsql.api.exception.InvalidVersionException;
public enum OptionalFeatures {
FAIL_ON_ERROR("3.0.3", null),
FRAMEWORK_COMPATIBILITY_CHECK("3.0.3", null);
private Version minVersion;
private Version maxVersion;
OptionalFeatures( String minVersion, String maxVersion )
{
if ( minVersion != null )
this.minVersion = new Version(minVersion);
if ( maxVersion != null)
this.maxVersion = new Version(maxVersion);
}
public boolean isAvailableFor(Version version ) {
try {
if ((minVersion == null || version.isGreaterOrEqualThan(minVersion)) &&
(maxVersion == null || maxVersion.isGreaterOrEqualThan(version))
)
return true;
else
return false;
} catch ( InvalidVersionException e ) {
return false; // We have no optional features for invalid versions
}
}
}