package p.studio.workspaces.assets.tiled;

import java.util.Objects;

public record TiledProperty(String name, String type, String value) {
    public TiledProperty {
        name = Objects.requireNonNull(name, "name").trim();
        type = Objects.requireNonNullElse(type, "string").trim();
        value = Objects.requireNonNullElse(value, "").trim();
        if (name.isBlank()) {
            throw new IllegalArgumentException("name must not be blank");
        }
        if (type.isBlank()) {
            type = "string";
        }
    }
}
