@Test(expectedExceptions = IllegalArgumentException.class) public void whenNullNameThenIsEnabledShouldThrow() throws Exception { final ProjectFeatureFlags flags = new ProjectFeatureFlags( singletonList(new ProjectFeatureFlag("enabledFlag", true))); flags.isEnabled(null); }
public boolean isEnabled(final String flagName) { notEmpty(flagName, "flagName"); for (final ProjectFeatureFlag flag : items) { if (flagName.equalsIgnoreCase(flag.getName())) { return flag.isEnabled(); } } return false; }
ProjectFeatureFlags implements Iterable<ProjectFeatureFlag> { public boolean isEnabled(final String flagName) { notEmpty(flagName, "flagName"); for (final ProjectFeatureFlag flag : items) { if (flagName.equalsIgnoreCase(flag.getName())) { return flag.isEnabled(); } } return false; } }
ProjectFeatureFlags implements Iterable<ProjectFeatureFlag> { public boolean isEnabled(final String flagName) { notEmpty(flagName, "flagName"); for (final ProjectFeatureFlag flag : items) { if (flagName.equalsIgnoreCase(flag.getName())) { return flag.isEnabled(); } } return false; } @JsonCreator  ProjectFeatureFlags(@JsonProperty("items") List<ProjectFeatureFlag> items); }
ProjectFeatureFlags implements Iterable<ProjectFeatureFlag> { public boolean isEnabled(final String flagName) { notEmpty(flagName, "flagName"); for (final ProjectFeatureFlag flag : items) { if (flagName.equalsIgnoreCase(flag.getName())) { return flag.isEnabled(); } } return false; } @JsonCreator  ProjectFeatureFlags(@JsonProperty("items") List<ProjectFeatureFlag> items); @Override Iterator<ProjectFeatureFlag> iterator(); boolean isEnabled(final String flagName); @Override String toString(); }
ProjectFeatureFlags implements Iterable<ProjectFeatureFlag> { public boolean isEnabled(final String flagName) { notEmpty(flagName, "flagName"); for (final ProjectFeatureFlag flag : items) { if (flagName.equalsIgnoreCase(flag.getName())) { return flag.isEnabled(); } } return false; } @JsonCreator  ProjectFeatureFlags(@JsonProperty("items") List<ProjectFeatureFlag> items); @Override Iterator<ProjectFeatureFlag> iterator(); boolean isEnabled(final String flagName); @Override String toString(); static final String PROJECT_FEATURE_FLAGS_URI; }