Class AutoStoreSetting
java.lang.Object
net.okocraft.box.feature.autostore.setting.AutoStoreSetting
A class to hold the user's auto-store settings.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAutoStoreSetting(@NotNull UUID uuid) The constructor of theAutoStoreSetting. -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull PerItemSettingGets thePerItemSetting.@NotNull UUIDgetUuid()Gets the user'sUUID.inthashCode()booleanWhether the current auto-store mode is all mode.booleanisDirect()Whether the direct auto-store is enabled.booleanWhether the auto-store is enabled or not.voidsetAllMode(boolean allMode) Sets the auto-store mode to all mode or per-item mode.voidsetDirect(boolean direct) Enables or disables the direct auto-store.voidsetEnabled(boolean enabled) Enables or disables the auto-store.booleanshouldAutoStore(@NotNull BoxItem item) Checks if theBoxItemshould be auto-stored.toString()
-
Field Details
-
KEY
-
-
Constructor Details
-
AutoStoreSetting
The constructor of theAutoStoreSetting.- Parameters:
uuid- the user'sUUID
-
-
Method Details
-
getUuid
Gets the user'sUUID.- Returns:
- the user's
UUID
-
getPerItemModeSetting
Gets thePerItemSetting.- Returns:
- the
PerItemSetting
-
isEnabled
public boolean isEnabled()Whether the auto-store is enabled or not.- Returns:
- if
true, the auto-store is enabled, or iffalse, it is disabled
-
setEnabled
public void setEnabled(boolean enabled) Enables or disables the auto-store.- Parameters:
enabled-trueto enable, orfalseto disable the auto-store
-
isAllMode
public boolean isAllMode()Whether the current auto-store mode is all mode.- Returns:
- if
true, the mode is all mode, or iffalse, it is per-item mode
-
setAllMode
public void setAllMode(boolean allMode) Sets the auto-store mode to all mode or per-item mode.- Parameters:
allMode-trueto all mode, orfalseto per-item mode.
-
isDirect
public boolean isDirect()Whether the direct auto-store is enabled.- Returns:
- if
true, the direct auto-store is enabled, or iffalse, it is disabled
-
setDirect
public void setDirect(boolean direct) Enables or disables the direct auto-store.- Parameters:
direct-trueto enable, orfalseto disable the direct auto-store
-
shouldAutoStore
Checks if theBoxItemshould be auto-stored.If the auto-store mode is all mode (
isAllMode()returnstrue), or ifPerItemSetting.isEnabled(BoxItem)returnstrue, this method returnstrue. Otherwise, this returnsfalse. -
equals
-
hashCode
public int hashCode() -
toString
-