Added ability to get all flavors from NodeFlavors
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import com.yahoo.config.provisioning.FlavorsConfig;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -30,6 +31,10 @@ public class NodeFlavors {
this.flavors = b.build();
}
+ public List<Flavor> getFlavors() {
+ return new ArrayList<>(flavors.values());
+ }
+
/** Returns a flavor by name, or empty if there is no flavor with this name. */
public Optional<Flavor> getFlavor(String name) {
return Optional.ofNullable(flavors.get(name));
