Class ATXConfig
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<ATXConfig>
-
- de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXConfig
-
- All Implemented Interfaces:
Describable<ATXConfig>
,Serializable
,Cloneable
public class ATXConfig extends AbstractDescribableImpl<ATXConfig> implements Cloneable, Serializable
Class holding the ATX configuration grouped by setting sections.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ATXConfig.DescriptorImpl
DescriptorImpl ofATXConfig
.
-
Constructor Summary
Constructors Constructor Description ATXConfig()
Instantiates a newATXConfig
with the default configuration.ATXConfig(List<ATXSetting<?>> settings, List<ATXCustomSetting> customSettings)
Instantiates a newATXConfig
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ATXConfig
clone()
Optional<ATXCustomSetting>
getCustomSettingByName(String name)
Gets the ATX custom setting by given setting name.List<ATXCustomSetting>
getCustomSettings()
Optional<ATXSetting<?>>
getSettingByName(String name)
Gets the ATX setting by given setting name.List<ATXSetting<?>>
getSettings()
List<ATXSetting<?>>
getSettingsByGroup(ATXSetting.SettingsGroup group)
Gets all ATX settings which belongs to a settings group.List<ATXSetting<?>>
getSettingsByGroupName(String groupName)
Gets all ATX settings which belongs to a named settings group.static ATXSetting.SettingsGroup
getSettingsGroup(String groupName)
Gets the ATX settings group by name.Object
getSettingValueByGroup(String name, ATXSetting.SettingsGroup group)
Gets the ATX setting by given setting name and a list of ATX settings.Object
getSettingValueByName(String name)
Gets the ATX setting value by given setting name from all ATX settings.Object
getSettingValueBySettings(String name, List<ATXSetting<?>> settings)
Gets the ATX setting value by given setting name from a list of ATX settings.protected Object
readResolve()
Used for backward compatibility using deprecated configuration map.void
setCustomSettings(List<ATXCustomSetting> customSettings)
void
setSettings(List<ATXSetting<?>> settings)
void
setSettingValueByName(String name, Object value)
Sets the ATX setting value by name if present.-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
ATXConfig
public ATXConfig()
Instantiates a newATXConfig
with the default configuration.
-
ATXConfig
@DataBoundConstructor public ATXConfig(List<ATXSetting<?>> settings, List<ATXCustomSetting> customSettings)
Instantiates a newATXConfig
.- Parameters:
settings
- the ATX settings mapcustomSettings
- the custom settings
-
-
Method Detail
-
readResolve
protected Object readResolve()
Used for backward compatibility using deprecated configuration map.- Returns:
- the settings to use after deserialization
- Since:
- 2.7.0
-
getSettings
public List<ATXSetting<?>> getSettings()
-
setSettings
public void setSettings(List<ATXSetting<?>> settings)
-
getCustomSettings
public List<ATXCustomSetting> getCustomSettings()
-
setCustomSettings
public void setCustomSettings(List<ATXCustomSetting> customSettings)
-
getSettingByName
public Optional<ATXSetting<?>> getSettingByName(String name)
Gets the ATX setting by given setting name.- Parameters:
name
- the setting name- Returns:
- the ATX setting or
null
if not found
-
getCustomSettingByName
public Optional<ATXCustomSetting> getCustomSettingByName(String name)
Gets the ATX custom setting by given setting name.- Parameters:
name
- the custom setting name- Returns:
- the ATX setting or
null
if not found
-
getSettingsByGroup
public List<ATXSetting<?>> getSettingsByGroup(ATXSetting.SettingsGroup group)
Gets all ATX settings which belongs to a settings group.- Parameters:
group
- the settings group- Returns:
- the list of ATX settings or empty list if not found
-
getSettingsByGroupName
public List<ATXSetting<?>> getSettingsByGroupName(String groupName)
Gets all ATX settings which belongs to a named settings group.- Parameters:
groupName
- the group name- Returns:
- the settings by group name
-
getSettingValueByName
public Object getSettingValueByName(String name) throws IllegalArgumentException
Gets the ATX setting value by given setting name from all ATX settings.- Parameters:
name
- the setting name- Returns:
- the setting value or
null
if not found - Throws:
IllegalArgumentException
-
getSettingValueBySettings
@CheckForNull public Object getSettingValueBySettings(String name, List<ATXSetting<?>> settings)
Gets the ATX setting value by given setting name from a list of ATX settings.- Parameters:
name
- the setting namesettings
- the setting list to search in- Returns:
- the setting value or
null
if not found
-
getSettingValueByGroup
@CheckForNull public Object getSettingValueByGroup(String name, ATXSetting.SettingsGroup group)
Gets the ATX setting by given setting name and a list of ATX settings.- Parameters:
name
- the setting namegroup
- the settings group- Returns:
- the ATX setting or
null
if not found
-
setSettingValueByName
public void setSettingValueByName(String name, Object value)
Sets the ATX setting value by name if present.- Parameters:
name
- the setting namevalue
- the setting value
-
getSettingsGroup
public static ATXSetting.SettingsGroup getSettingsGroup(String groupName)
Gets the ATX settings group by name.- Parameters:
groupName
- the group name- Returns:
- the settings group
-
-