public class VersionENV
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
ALLOW_DEPRECATED_VERSION |
protected java.util.concurrent.atomic.AtomicInteger |
databaseVersion |
int |
defaultVersion |
protected java.util.concurrent.ConcurrentHashMap<java.lang.Integer,java.lang.String> |
deprecatedVersionMap |
protected java.lang.String |
environmentName |
protected java.util.concurrent.atomic.AtomicInteger |
environmentVersion |
int |
maxVersion |
int |
minVersion |
Constructor and Description |
---|
VersionENV(java.lang.String environmentName,
int defaultVersion,
int minVersion,
int maxVersion)
create a new version
|
Modifier and Type | Method and Description |
---|---|
int |
calculateVersion()
Calculate the current version number to use.
|
void |
deprecateVersion(int version,
java.lang.String message)
Do not allow this version to be used in production
|
int |
setDataBaseVersion(int version)
set the version
|
java.lang.String |
toString() |
public final int defaultVersion
public final int minVersion
public final int maxVersion
protected final java.util.concurrent.atomic.AtomicInteger databaseVersion
protected final java.util.concurrent.atomic.AtomicInteger environmentVersion
protected final java.lang.String environmentName
protected final java.util.concurrent.ConcurrentHashMap<java.lang.Integer,java.lang.String> deprecatedVersionMap
protected static final boolean ALLOW_DEPRECATED_VERSION
public VersionENV(@Nonnull java.lang.String environmentName, @Nonnegative int defaultVersion, @Nonnegative int minVersion, @Nonnegative int maxVersion)
environmentName
- the environment variable name.defaultVersion
- the default version to useminVersion
- minimum versionmaxVersion
- maximum version@CheckReturnValue @Nonnull public java.lang.String toString()
toString
in class java.lang.Object
public void deprecateVersion(@Nonnegative int version, @Nonnull java.lang.String message)
version
- The version numbermessage
- The reason message.@Nonnegative public int setDataBaseVersion(@Nonnegative int version)
version
- the version, ZERO means default@CheckReturnValue @Nonnegative public int calculateVersion()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.