Class ErrorCodeConfig
- java.lang.Object
-
- com.exasol.errorcodecrawlermavenplugin.config.ErrorCodeConfig
-
public class ErrorCodeConfig extends Object
This class represents the contents of the errorCodeConfig.yml. It is created byErrorCodeConfigReader.
-
-
Constructor Summary
Constructors Constructor Description ErrorCodeConfig(Map<String,SingleErrorCodeConfig> errorTags)Create a new instance ofErrorCodeConfig.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>getErrorTagForPackage(String packageName)Get the error tag configured for a specific java package.intgetHighestIndexForErrorTag(String errorTag)Get the highest index of an error code.List<String>getPackagesForErrorTag(String errorTag)booleanhasErrorTag(String errorTag)Check if a specific error tag is declared in the configuration file.StringtoString()
-
-
-
Constructor Detail
-
ErrorCodeConfig
public ErrorCodeConfig(Map<String,SingleErrorCodeConfig> errorTags)
Create a new instance ofErrorCodeConfig.- Parameters:
errorTags- error tag entries
-
-
Method Detail
-
getErrorTagForPackage
public Optional<String> getErrorTagForPackage(String packageName)
Get the error tag configured for a specific java package.- Parameters:
packageName- name of the package- Returns:
- corresponding error tag
-
getPackagesForErrorTag
public List<String> getPackagesForErrorTag(String errorTag)
- Parameters:
errorTag- error tag e.g:EXA-TEST- Returns:
- list of packages that can declare this error code
-
hasErrorTag
public boolean hasErrorTag(String errorTag)
Check if a specific error tag is declared in the configuration file.- Parameters:
errorTag- error tag to check- Returns:
trueif the tag was declared.
-
getHighestIndexForErrorTag
public int getHighestIndexForErrorTag(String errorTag)
Get the highest index of an error code.- Parameters:
errorTag- error code- Returns:
- highest index (according to the config file)
-
-