Class Settings
java.lang.Object
com.mrivanplays.annotationconfig.core.resolver.settings.Settings
Represents a
Setting holder.- Since:
- 3.0.0
- Author:
- MrIvanPlays
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCombines the specifiedSettingswith thisSettingsinstance.copy()Creates a mutable copy of the current settings object.copy(boolean immutable) Creates a copy of the current settings object.boolean<T> Optional<T>Get the stored value in these settings of the specifiedSetting, if any.booleanChecks whether this settings instance stores a value for this settinginthashCode()booleanReturns whether this settings instance is immutable.<T> SettingsPuts the specifiedSettingsettingvalueinto this settings instance, or if it already exists it replaces it.
-
Constructor Details
-
Settings
public Settings()
-
-
Method Details
-
copy
Creates a mutable copy of the current settings object.- Returns:
- copy
-
copy
Creates a copy of the current settings object.- Parameters:
immutable- whether the copy to be immutable- Returns:
- copy
-
has
Checks whether this settings instance stores a value for this setting- Parameters:
setting- setting- Returns:
- whether it has value or not
-
immutable
Returns whether this settings instance is immutable.- Returns:
- immutable or not
-
put
Puts the specifiedSettingsettingvalueinto this settings instance, or if it already exists it replaces it.- Type Parameters:
T- value type- Parameters:
setting- setting to modifyvalue- value to put/replace- Returns:
- this settings instance for chaining
- Throws:
IllegalArgumentException- when the setting key is occupied by another value data type
-
combine
Combines the specifiedSettingswith thisSettingsinstance. If a setting, that is present in the specified settings, is also present in this settings instance, then the value of this settings instance is respected.- Parameters:
settings- settings to combine with- Returns:
- this instance for chaining
-
get
Get the stored value in these settings of the specifiedSetting, if any.- Type Parameters:
T- value type- Parameters:
setting- the setting needed to get- Returns:
- empty optional or optional fulfilled with value
- Throws:
IllegalArgumentException- if the submitted setting's type mismatches the setting type held.
-
equals
-
hashCode
-