Class Settings
java.lang.Object
com.mrivanplays.annotationconfig.core.resolver.settings.Settings
Represents a
Setting
holder.- Since:
- 3.0.0
- Author:
- MrIvanPlays
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCombines the specifiedSettings
with thisSettings
instance.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.boolean
Checks whether this settings instance stores a value for this settingint
hashCode()
boolean
Returns whether this settings instance is immutable.<T> Settings
Puts the specifiedSetting
setting
value
into 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 specifiedSetting
setting
value
into 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 specifiedSettings
with thisSettings
instance. 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
-