use of no.stelar7.api.r4j.pojo.lol.status.PlatformData in project L4J8 by stelar7.
the class StatusAPI method getShardStatus.
public PlatformData getShardStatus(RuneterraShard server) {
DataCallBuilder builder = new DataCallBuilder().withEndpoint(URLEndpoint.V1_STATUS_LOR).withPlatform(server);
Map<String, Object> data = new TreeMap<>();
data.put("platform", server);
Optional<?> chl = DataCall.getCacheProvider().get(URLEndpoint.V1_STATUS_LOR, data);
if (chl.isPresent()) {
return (PlatformData) chl.get();
}
try {
PlatformData list = (PlatformData) builder.build();
data.put("value", list);
DataCall.getCacheProvider().store(URLEndpoint.V1_STATUS_LOR, data);
return list;
} catch (ClassCastException e) {
return null;
}
}
use of no.stelar7.api.r4j.pojo.lol.status.PlatformData in project L4J8 by stelar7.
the class StatusAPI method getShardStatus.
public PlatformData getShardStatus(LeagueShard server) {
DataCallBuilder builder = new DataCallBuilder().withEndpoint(URLEndpoint.V4_STATUS_LOL).withPlatform(server);
Map<String, Object> data = new TreeMap<>();
data.put("platform", server);
Optional<?> chl = DataCall.getCacheProvider().get(URLEndpoint.V4_STATUS_LOL, data);
if (chl.isPresent()) {
return (PlatformData) chl.get();
}
try {
PlatformData list = (PlatformData) builder.build();
data.put("value", list);
DataCall.getCacheProvider().store(URLEndpoint.V4_STATUS_LOL, data);
return list;
} catch (ClassCastException e) {
return null;
}
}
use of no.stelar7.api.r4j.pojo.lol.status.PlatformData in project L4J8 by stelar7.
the class StatusAPI method getShardStatus.
public PlatformData getShardStatus(ValorantShard server) {
DataCallBuilder builder = new DataCallBuilder().withEndpoint(URLEndpoint.V1_STATUS_VAL).withPlatform(server);
Map<String, Object> data = new TreeMap<>();
data.put("platform", server);
Optional<?> chl = DataCall.getCacheProvider().get(URLEndpoint.V1_STATUS_VAL, data);
if (chl.isPresent()) {
return (PlatformData) chl.get();
}
try {
PlatformData list = (PlatformData) builder.build();
data.put("value", list);
DataCall.getCacheProvider().store(URLEndpoint.V1_STATUS_VAL, data);
return list;
} catch (ClassCastException e) {
return null;
}
}
use of no.stelar7.api.r4j.pojo.lol.status.PlatformData in project L4J8 by stelar7.
the class StatusTest method testStatus.
@Test
public void testStatus() {
PlatformData shardStatus = api.getShardStatus(LeagueShard.EUW1);
PlatformData shardStatus1 = api.getShardStatus(RuneterraShard.EUROPE);
PlatformData shardStatus2 = api.getShardStatus(ValorantShard.EU);
}
Aggregations