// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;

import java.util.EnumSet;
import java.util.Set;

/**
 * Systems in hosted Vespa
 *
 * @author mpolden
 */
public enum SystemName {

    /** Local development system */
    dev,

    /** Continuous deployment system */
    cd,

    /** Production system */
    main,

    /** System accessible for the public */
    Public,

    /** Continuous deployment system for testing the Public system */
    PublicCd,

    /** VaaS */
    vaas; // TODO: Remove this and use public everywhere

    public static SystemName defaultSystem() {
        return main;
    }

    public static SystemName from(String value) {
        switch (value.toLowerCase()) {
            case "dev": return dev;
            case "cd": return cd;
            case "main": return main;
            case "public": return Public;
            case "publiccd": return PublicCd;
            case "vaas": return vaas;
            default: throw new IllegalArgumentException(String.format("'%s' is not a valid system", value));
        }
    }

    public String value() {
        switch (this) {
            case dev: return "dev";
            case cd: return "cd";
            case main: return "main";
            case Public: return "public";
            case PublicCd: return "publiccd";
            default : throw new IllegalStateException();
        }
    }

    public static Set<SystemName> all() {
        return EnumSet.allOf(SystemName.class);
    }

}

@@ -1400,24 +1400,62 @@
 %22publiccd%22;%0A
+            case vaas: return %22vaas%22;%0A
             

Add vaas to SystemName::value