atualizar gradle

This commit is contained in:
2026-03-10 15:27:02 +00:00
parent 894c9a845c
commit 702320e819
6 changed files with 213 additions and 140 deletions

View File

@@ -3,9 +3,9 @@ package com.example.vdcscore.models;
import com.google.firebase.database.PropertyName;
import java.util.ArrayList;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
public class Club implements Serializable {
@PropertyName("id")
private int id;
@@ -29,11 +29,11 @@ public class Club implements Serializable {
private String president;
@PropertyName("jogadores")
private ArrayList<Player> players;
private HashMap<String, Player> players;
public Club() {
// Default constructor for Firebase
players = new ArrayList<>();
players = new HashMap<>();
}
public Club(int id, String name, String imageUrl, String stadium, int foundationYear, String address,
@@ -45,7 +45,7 @@ public class Club implements Serializable {
this.foundationYear = foundationYear;
this.address = address;
this.president = president;
this.players = new ArrayList<>();
this.players = new HashMap<>();
}
@PropertyName("id")
@@ -119,18 +119,18 @@ public class Club implements Serializable {
}
@PropertyName("jogadores")
public ArrayList<Player> getPlayersMap() {
public HashMap<String, Player> getPlayersMap() {
return players;
}
@PropertyName("jogadores")
public void setPlayersMap(ArrayList<Player> players) {
public void setPlayersMap(HashMap<String, Player> players) {
this.players = players;
}
public List<Player> getPlayersList() {
if (players == null)
return new ArrayList<>();
return new ArrayList<>(players);
return new ArrayList<>(players.values());
}
}

View File

@@ -1,8 +1,9 @@
package com.example.vdcscore.models;
import java.io.Serializable;
import com.google.firebase.database.PropertyName;
public class Player {
public class Player implements Serializable {
@PropertyName("id")
private int id;