
com.speedment.runtime.core.util.FeatureReadinessLevel Maven / Gradle / Ivy
/**
*
* Copyright (c) 2006-2018, Speedment, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); You may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.speedment.runtime.core.util;
import com.speedment.runtime.core.exception.SpeedmentException;
/**
*
* @author Per Minborg
*/
public enum FeatureReadinessLevel {
/**
* The feature is pure experimental whereby the API is likely to change,
* there are no or limited test coverage and the feature is likely to
* exhibit unpredictable behavior including erratic results, memory leaks,
* lingering resource allocations and complete JVM crashes. The feature may
* also be removed at any time without prior notice.
*
* THE USE OF THE FEATURE IN PRODUCTION SYSTEM IS DISSALOWED.
*/
EXPERIMENTAL,
/**
* The feature has undergone limited testing and the API is likely to change
* but likely not in a material way. The feature may exhibit unpredictable
* behavior including erratic results, memory leaks, lingering resource
* allocations.
*
* THE USE OF THE FEATURE IN PRODUCTION SYSTEM IS HIGHLY DISCOURAGED.
*/
PREVIEW,
/**
* The feature has undergone testing and the API is unlikely to undergo
* anything else than minor changes. The feature might exhibit unpredictable
* behavior including erratic results, memory leaks, lingering resource
* allocations.
*
* THE USE OF THE FEATURE IN PRODUCTION SYSTEM IS DISCOURAGED.
*/
API_STABLE,
/**
* The feature has undergone regular testing and the API is stable. The
* feature is unlikely to exhibit unpredictable behavior such as erratic
* results, memory leaks, lingering resource allocations.
*
* THE USE OF THE FEATURE IN PRODUCTION SYSTEM IS NOT RECOMMENDED.
*/
RELEASE_CANDIDATE;
public void assertAtLeast(FeatureReadinessLevel requiredLevel) {
if (this.compareTo(requiredLevel) < 0) {
throw new SpeedmentException(
"The requred " + FeatureReadinessLevel.class.getSimpleName() + " was " + requiredLevel
+ " but this feature is only at level " + this
);
}
}
}