atualizar gradle
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user