All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.hansolo.fx.countries.tools.Records Maven / Gradle / Ivy

Go to download

Countries is a JavaFX library containing controls and info for countries and cities

There is a newer version: 21.0.3
Show newest version
package eu.hansolo.fx.countries.tools;

import eu.hansolo.fx.countries.Country;


public class Records {
    public record City(String name, double lat, double lon, Country country, boolean isCapital, long population){
        @Override public String toString() {
            return new StringBuilder().append("{")
                                      .append("\"name\":\"").append(name).append("\",")
                                      .append("\"lat\":").append(lat).append(",")
                                      .append("\"lon\":").append(lat).append(",")
                                      .append("\"country\":\"").append(country.getDisplayName()).append("\",")
                                      .append("\"iso2\":\"").append(country.getIso2()).append("\",")
                                      .append("\"capital\":").append(isCapital).append(",")
                                      .append("\"population\":").append(population)
                                      .append("}")
                                      .toString();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy