package org.takiguchi.cerberus.cerberusapp.model;

import java.util.UUID;

public class Application {
    private final UUID id;
    /** The name to display. */
    private final String name;
    /** The technical service name, like a docker container name or a system V service name. */
    private final String serviceName;
    private final ServiceType serviceType;
    private final String image;

    public static Builder anApplication() {
        return new Builder();
    }

    private Application(UUID id, String name, String serviceName, ServiceType serviceType, String image) {
        this.id = id;
        this.name = name;
        this.serviceName = serviceName;
        this.serviceType = serviceType;
        this.image = image;
    }

    public UUID getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getServiceName() {
        return serviceName;
    }

    public ServiceType getServiceType() {
        return serviceType;
    }

    public String getImage() {
        return image;
    }

    public static class Builder {
        private UUID id;
        private String name;
        private String serviceName;
        private ServiceType serviceType;
        private String image;

        private Builder() {
        }

        public Builder withId(UUID id) {
            this.id = id;
            return this;
        }

        public Builder withName(String name) {
            this.name = name;
            return this;
        }

        public Builder withServiceName(String serviceName) {
            this.serviceName = serviceName;
            return this;
        }

        public Builder withServiceType(ServiceType serviceType) {
            this.serviceType = serviceType;
            return this;
        }

        public Builder withImage(String image) {
            this.image = image;
            return this;
        }

        public Application build() {
            return new Application(id, name, serviceName, serviceType, image);
        }
    }
}
