All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.teamscale.index.metadata.abap.ECompatibilityContract Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) CQSE GmbH
 *
 * 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.teamscale.index.metadata.abap;

import org.conqat.lib.commons.js_export.ExportToTypeScript;
import org.conqat.lib.commons.test.IndexValueClass;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Defines the possible values of a release contract. See 
 *  and 
 *  for more information.
 */
@ExportToTypeScript
@IndexValueClass
public enum ECompatibilityContract {

	/**
	 * Identifies a compatibility contract type that is not known to Teamscale and for which support
	 * need to be provided.
	 */
	UNKNOWN("~", "Unknown"),

	/**
	 * C0 contract allows enhancement fields to be added at specified extension options.
	 */
	EXTEND("C0", "Extend"),

	/**
	 * C1 contract guarantees a stable interface for use within the AS ABAP.
	 */
	USE_SYSTEM_INTERNALLY("C1", "System internal"),

	/**
	 * C2 contract guarantees a stable interface for use outside the AS ABAP.
	 */
	USE_AS_REMOTE_API("C2", "Remote API"),

	/**
	 * C3 contract ensures a stable persistence for configuration content.
	 */
	MANAGE_CONFIGURATION_CONTENT("C3", "Configuration content"),

	/**
	 * This contract ensures a technically stable public interface for use in ABAP Managed Database
	 * Procedures.
	 */
	USE_IN_ABAP_MANAGED_DATABASE_PROCEDURES("C4", "Database Procedures");

	private static final String ID_PROPERTY = "id";

	private static final String HUMAN_READABLE_NAME_PROPERTY = "humanReadableName";

	@JsonProperty(ID_PROPERTY)
	private final String id;

	@JsonProperty(HUMAN_READABLE_NAME_PROPERTY)
	private final String humanReadableName;

	@JsonCreator
	ECompatibilityContract(@JsonProperty(ID_PROPERTY) String id,
			@JsonProperty(HUMAN_READABLE_NAME_PROPERTY) String humanReadableName) {
		this.id = id;
		this.humanReadableName = humanReadableName;
	}

	/**
	 * Derives a {@link ECompatibilityContract} from some given id. Returns {@link #UNKNOWN} if the type
	 * value is not defined in this enumeration.
	 */
	public static ECompatibilityContract getCompatibilityContract(String id) {
		for (ECompatibilityContract compatibilityContract : ECompatibilityContract.values()) {
			if (compatibilityContract.id.equals(id)) {
				return compatibilityContract;
			}
		}

		return UNKNOWN;
	}

	/** @see #id */
	public String getId() {
		return id;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy