Package com.solibri.smc.api.settings
Interface Setting<T>
- All Known Implementing Classes:
- BooleanSetting,- DoubleSetting,- IntegerSetting,- PasswordSetting,- StringSetting
public interface Setting<T>
Setting defines a setting for the application. 3rd party developers can implement this interface to be able to have
 their custom settings visible in the UI, usable in their other 3rd party components, such as 
Views and
 handled automatically by Solibri.
 It is not normal to implement this interface. Usually developers should extend the abstract classes that implement
 this.- Since:
- 9.10.8
- 
Method SummaryModifier and TypeMethodDescriptionDefines the default value that the setting has when it is first introduced to the software.default StringThe internationalized description of the setting.default StringgetName()The internationalized name of the setting.The unique ID of the setting.getValue()Returns the current value of the setting.invalidReason(T value) This method is implemented to define valid values for this setting.voidSets the value of the setting.
- 
Method Details- 
getUniqueIdString getUniqueId()The unique ID of the setting. This needs to be globally unique.- Returns:
- the ID of the setting
- Since:
- 9.10.8
 
- 
getNameThe internationalized name of the setting. The default implementation returns value based on properties files value with key "NAME". Returns the ID of the setting if no property is found.- Returns:
- the name of the view
- Since:
- 9.10.8
 
- 
getDescriptionThe internationalized description of the setting. The default implementation returns value based on properties files value with key "DESCRIPTION". Returns the name of the setting if no property is found.- Returns:
- the name of the view
- Since:
- 9.10.8
 
- 
getValueT getValue()Returns the current value of the setting. This returns the new value of the setting immediately after it has been changed, but note that it is up to the users of settings to decide if the new value takes effect immediately or after a restart.- Returns:
- the value
- Since:
- 9.10.8
 
- 
getDefaultValueT getDefaultValue()Defines the default value that the setting has when it is first introduced to the software.- Returns:
- the default value
 
- 
setValueSets the value of the setting.- Parameters:
- value- the value to be set
- Since:
- 9.10.8
 
- 
invalidReasonThis method is implemented to define valid values for this setting. For example, for an integer valued setting, only positive integers might be valid values. If the given value is invalid, the method should return the reason for it being invalid. In the given value is valid, Optional.empty() should be returned.- Parameters:
- value- the value to be checked for validity
- Returns:
- true if the given value is valid, false otherwise
 
 
-