Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

You removed Alliance Member api for some reason #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public interface IPoliticsAndWar {

Alliance getAlliance(int allianceId) throws IOException;

AllianceMembers getAllianceMembers(int allianceId) throws IOException;

Alliances getAlliances() throws IOException;

NationMilitary getAllMilitaries() throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public Alliance getAlliance(int allianceId) throws IOException {
return (Alliance) execute(new AllianceQuery(allianceId, apiKeyPool.getNextApiKey()).build());
}

@Override
public AllianceMembers getAllianceMembers(int allianceId) throws IOException {
return (AllianceMembers) execute(new AllianceMembersQuery(allianceId, apiKeyPool.getNextApiKey()).build());
}

@Override
public Alliances getAlliances() throws IOException {
return (Alliances) execute(new AlliancesQuery(apiKeyPool.getNextApiKey()).build());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package io.github.adorableskullmaster.pw4j.domains;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import io.github.adorableskullmaster.pw4j.domains.subdomains.AllianceMembersContainer;

import java.util.List;
import java.util.Objects;

public class AllianceMembers extends Entity {

@SerializedName("success")
@Expose
private Boolean success;
@SerializedName("nations")
@Expose
private List<AllianceMembersContainer> nations = null;

public Boolean isSuccess() {
return success;
}

public List<AllianceMembersContainer> getNations() {
return nations;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AllianceMembers that = (AllianceMembers) o;
return Objects.equals(success, that.success) &&
Objects.equals(nations, that.nations);
}

@Override
public int hashCode() {
return Objects.hash(success, nations);
}

@Override
public String toString() {
return "AllianceMembers{" +
"success=" + success +
", nations=" + nations +
'}';
}
}
Loading