public OpenstackSession() { // calculate the bitmap for (Feature f : Feature.class.getEnumConstants()) { if (f.isEnabled()) { features = features | f.mask(); } } computeConfig = new OpenStackComputeConfig(); identityConfig = new OpenStackIdentityConfig(); imageConfig = new OpenStackImageConfig(); }
public OpenstackSession disable(Feature feature) { features = features & ~feature.mask(); return this; }
public OpenstackSession enable(Feature feature) { features = features | feature.mask(); return this; }
public OpenstackSession without(Feature... features) { for (Feature feature : features) { this.features = this.features & ~feature.mask(); } return this; }
public boolean isEnabled(Feature feature) { return (features & feature.mask()) == 1; }