Class AutoStoreSetting
java.lang.Object
net.okocraft.box.feature.autostore.setting.AutoStoreSetting
A class to hold the user's auto-store settings.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAutoStoreSetting
(@NotNull UUID uuid) The constructor of theAutoStoreSetting
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull PerItemSetting
Gets thePerItemSetting
.@NotNull UUID
getUuid()
Gets the user'sUUID
.int
hashCode()
boolean
Whether the current auto-store mode is all mode.boolean
isDirect()
Whether the direct auto-store is enabled.boolean
Whether the auto-store is enabled or not.void
setAllMode
(boolean allMode) Sets the auto-store mode to all mode or per-item mode.void
setDirect
(boolean direct) Enables or disables the direct auto-store.void
setEnabled
(boolean enabled) Enables or disables the auto-store.boolean
shouldAutoStore
(@NotNull BoxItem item) Checks if theBoxItem
should 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
-true
to enable, orfalse
to 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
-true
to all mode, orfalse
to 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
-true
to enable, orfalse
to disable the direct auto-store
-
shouldAutoStore
Checks if theBoxItem
should 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
-