public static int getIntFeatureValue(final Collection<Feature> features, final int requestedFeatureId) { int result = 0; Feature feature = Feature.findFeature(features, requestedFeatureId); if (feature != null) { result = feature.getValue(); } return result; }
public static Boolean getBooleanFeatureValue(final Collection<Feature> features, final int requestedFeatureId) { Boolean result = null; Feature feature = Feature.findFeature(features, requestedFeatureId); if (feature != null) { result = feature.getValue() > 0; } return result; }
/** * Set a feature. * * @param feature * the feature to set */ public void setFeature(Feature feature) { LOGGER.info("Set feature: {}", feature); Feature existing = Feature.findFeature(this.features, feature.getType()); if (existing != null) { LOGGER.info("Remove existing feature: {}", existing); features.remove(existing); } features.add(feature); LOGGER.debug("The feature has changed: {}", feature); pcs.firePropertyChange(PROPERTY_FEATURES, null, features); }