package core.models;

public class Car
{
    private final int id;

    private final String name;
    private final String type;
    private final String color;

    private final float volume;

    public Car(int id, String name, String type, String color, float volume)
    {
        this.id = id;

        this.name = name;
        this.type = type;
        this.color = color;

        this.volume = volume;
    }

    public int getId()
    {
        return id;
    }

    public String getName()
    {
        return name;
    }

    public String getType()
    {
        return type;
    }

    public float getVolume()
    {
        return volume;
    }

    public String getColor()
    {
        return color;
    }

    @Override
    public String toString()
    {
        String format = "{\"id\": %d, \"name\": %s, \"type\":  %s, \"color\": %s, \"volume\": %.1f}";
        return String.format(format, id, name, type, color, volume);
    }
}
