Record Class Minesweeper.CellView
java.lang.Object
java.lang.Record
net.flectone.pulse.module.command.minesweeper.model.Minesweeper.CellView
- Enclosing class:
Minesweeper
public static record Minesweeper.CellView(int row, int column, boolean revealed, boolean flagged, boolean mine, int adjacentMines)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionCellView(int row, int column, boolean revealed, boolean flagged, boolean mine, int adjacentMines) Creates an instance of aCellViewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theadjacentMinesrecord component.intcolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanflagged()Returns the value of theflaggedrecord component.final inthashCode()Returns a hash code value for this object.booleanisEmpty()booleanmine()Returns the value of theminerecord component.booleanrevealed()Returns the value of therevealedrecord component.introw()Returns the value of therowrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CellView
public CellView(int row, int column, boolean revealed, boolean flagged, boolean mine, int adjacentMines) Creates an instance of aCellViewrecord class.- Parameters:
row- the value for therowrecord componentcolumn- the value for thecolumnrecord componentrevealed- the value for therevealedrecord componentflagged- the value for theflaggedrecord componentmine- the value for theminerecord componentadjacentMines- the value for theadjacentMinesrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
row
public int row()Returns the value of therowrecord component.- Returns:
- the value of the
rowrecord component
-
column
public int column()Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-
revealed
public boolean revealed()Returns the value of therevealedrecord component.- Returns:
- the value of the
revealedrecord component
-
flagged
public boolean flagged()Returns the value of theflaggedrecord component.- Returns:
- the value of the
flaggedrecord component
-
mine
public boolean mine()Returns the value of theminerecord component.- Returns:
- the value of the
minerecord component
-
adjacentMines
public int adjacentMines()Returns the value of theadjacentMinesrecord component.- Returns:
- the value of the
adjacentMinesrecord component
-