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

com.commercetools.rmf.validators.DiagnosticsCreator.kt Maven / Gradle / Ivy

Go to download

RAML API client code generators based on the REST Modeling Framework. https://github.com/vrapio/rest-modeling-framework

There is a newer version: 1.0.0-20241120142200
Show newest version
package com.commercetools.rmf.validators

import org.eclipse.emf.common.util.Diagnostic
import org.eclipse.emf.ecore.EObject

interface DiagnosticsCreator: io.vrap.rmf.raml.validation.DiagnosticsCreator

interface DiagnosticsAware: DiagnosticsCreator {
    val severity: RuleSeverity

    fun create(eObject: EObject, messagePattern: String, vararg messageArgs: Any?): Diagnostic {
        return when (severity) {
            RuleSeverity.ERROR -> error(eObject, messagePattern, *messageArgs)
            RuleSeverity.WARN -> warning(eObject, messagePattern, *messageArgs)
            else -> create(Diagnostic.INFO, eObject, messagePattern, *messageArgs)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy