feat: premier jet de la conception basique du sudoku
This commit is contained in:
35
app/src/main/java/sudoku/Symbole.java
Normal file
35
app/src/main/java/sudoku/Symbole.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package sudoku;
|
||||
|
||||
public class Symbole {
|
||||
private final String valeur;
|
||||
|
||||
public Symbole(String symbole) {
|
||||
this.valeur = symbole;
|
||||
}
|
||||
|
||||
// Factory methods pour différents types
|
||||
public static Symbole of(String s) {
|
||||
return new Symbole(s);
|
||||
}
|
||||
|
||||
public static Symbole of(int n) {
|
||||
return new Symbole(String.valueOf(n));
|
||||
}
|
||||
|
||||
public static Symbole of(char c) {
|
||||
return new Symbole(String.valueOf(c));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return valeur;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
Symbole symbole = (Symbole) obj;
|
||||
return valeur.equals(symbole.valeur);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user