init commit
This commit is contained in:
16
src/main/java/dev/clanders/weatherapi/response/Location.java
Normal file
16
src/main/java/dev/clanders/weatherapi/response/Location.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package dev.clanders.weatherapi.response;
|
||||
|
||||
public class Location {
|
||||
public double lat;
|
||||
public double lon;
|
||||
public String name;
|
||||
public String type;
|
||||
|
||||
public String getCountry() {
|
||||
// Probably not efficient to be splitting this string every time, but does
|
||||
// it really matter in an app this size????
|
||||
String[] locationValues = name.split(",");
|
||||
|
||||
return locationValues[locationValues.length - 1].trim();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user