Record Class ArenaView
java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.arena.ArenaView
@AnyThread
public record ArenaView(@NotNull String id, @Nullable String worldName, boolean enabled, boolean conveyorValid, @Nullable org.bukkit.Location pos1, @Nullable org.bukkit.Location pos2, @Nullable org.bukkit.Location conveyorStart, @Nullable org.bukkit.Location conveyorEnd, @NotNull List<PlotView> plots)
extends Record
Immutable snapshot of an arena and its plots.
-
Constructor Summary
ConstructorsConstructorDescriptionArenaView(@NotNull String id, @Nullable String worldName, boolean enabled, boolean conveyorValid, @Nullable org.bukkit.Location pos1, @Nullable org.bukkit.Location pos2, @Nullable org.bukkit.Location conveyorStart, @Nullable org.bukkit.Location conveyorEnd, @NotNull List<PlotView> plots) Creates an instance of aArenaViewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionint@Nullable org.bukkit.LocationReturns the value of theconveyorEndrecord component.@Nullable org.bukkit.LocationReturns the value of theconveyorStartrecord component.booleanReturns the value of theconveyorValidrecord component.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.intplots()Returns the value of theplotsrecord component.@Nullable org.bukkit.Locationpos1()Returns the value of thepos1record component.@Nullable org.bukkit.Locationpos2()Returns the value of thepos2record component.final StringtoString()Returns a string representation of this record class.@Nullable StringReturns the value of theworldNamerecord component.
-
Constructor Details
-
ArenaView
public ArenaView(@NotNull @NotNull String id, @Nullable @Nullable String worldName, boolean enabled, boolean conveyorValid, @Nullable @Nullable org.bukkit.Location pos1, @Nullable @Nullable org.bukkit.Location pos2, @Nullable @Nullable org.bukkit.Location conveyorStart, @Nullable @Nullable org.bukkit.Location conveyorEnd, @NotNull @NotNull List<PlotView> plots) Creates an instance of aArenaViewrecord class.- Parameters:
id- the value for theidrecord componentworldName- the value for theworldNamerecord componentenabled- the value for theenabledrecord componentconveyorValid- the value for theconveyorValidrecord componentpos1- the value for thepos1record componentpos2- the value for thepos2record componentconveyorStart- the value for theconveyorStartrecord componentconveyorEnd- the value for theconveyorEndrecord componentplots- the value for theplotsrecord component
-
-
Method Details
-
availablePlotCount
public int availablePlotCount() -
occupiedPlotCount
public int occupiedPlotCount() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
worldName
Returns the value of theworldNamerecord component.- Returns:
- the value of the
worldNamerecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
conveyorValid
public boolean conveyorValid()Returns the value of theconveyorValidrecord component.- Returns:
- the value of the
conveyorValidrecord component
-
pos1
@Nullable public @Nullable org.bukkit.Location pos1()Returns the value of thepos1record component.- Returns:
- the value of the
pos1record component
-
pos2
@Nullable public @Nullable org.bukkit.Location pos2()Returns the value of thepos2record component.- Returns:
- the value of the
pos2record component
-
conveyorStart
@Nullable public @Nullable org.bukkit.Location conveyorStart()Returns the value of theconveyorStartrecord component.- Returns:
- the value of the
conveyorStartrecord component
-
conveyorEnd
@Nullable public @Nullable org.bukkit.Location conveyorEnd()Returns the value of theconveyorEndrecord component.- Returns:
- the value of the
conveyorEndrecord component
-
plots
-