List of usage examples for java.util EnumSet noneOf
public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType)
From source file:com.janrain.backplane.server.config.BusConfig.java
public EnumSet<BackplaneConfig.BUS_PERMISSION> getPermissions(String user) { if (isBusConfigField(user)) { throw new IllegalArgumentException("Invalid user name: " + user); }//from ww w . j a va2s . c om String perms = get(user); EnumSet<BackplaneConfig.BUS_PERMISSION> result = EnumSet.noneOf(BackplaneConfig.BUS_PERMISSION.class); if (StringUtils.isNotBlank(perms)) { for (String perm : perms.split(",")) { result.add(BackplaneConfig.BUS_PERMISSION.valueOf(perm)); } } return result; }
From source file:org.trnltk.model.lexicon.DynamicLexeme.java
public DynamicLexeme(String lemma, String lemmaRoot, PrimaryPos primaryPos, SecondaryPos secondaryPos, EnumSet<LexemeAttribute> lexemeAttributes) { this.lemma = lemma; this.lemmaRoot = lemmaRoot; this.primaryPos = primaryPos; this.secondaryPos = secondaryPos; this.lexemeAttributes = CollectionUtils.isEmpty(lexemeAttributes) ? EnumSet.noneOf(LexemeAttribute.class) : lexemeAttributes;//from www .ja v a 2s .com }
From source file:org.mozilla.gecko.home.SearchLoader.java
public static void restart(LoaderManager manager, int loaderId, LoaderCallbacks<Cursor> callbacks, String searchTerm) {/*www . j ava2 s.c o m*/ restart(manager, loaderId, callbacks, searchTerm, EnumSet.noneOf(FilterFlags.class)); }
From source file:org.culturegraph.mf.sql.util.JdbcUtil.java
public static EnumSet<Bug> getDriverBugs(final Connection connection) { final EnumSet<Bug> driverBugs = EnumSet.noneOf(Bug.class); final String driverName; try {// ww w . ja v a 2 s . c om driverName = connection.getMetaData().getDriverName(); } catch (final SQLException e) { throw new MetafactureException(e); } if ("PostgreSQL Native Driver".equals(driverName)) { driverBugs.add(Bug.RETURN_GENERATED_KEYS_PRODUCES_INVALID_SQL); } else if ("SQLiteJDBC".equals(driverName)) { driverBugs.add(Bug.GET_RESULT_SET_THROWS_ILLEGAL_EXCEPTION); driverBugs.add(Bug.GET_UPDATE_COUNT_THROWS_ILLEGAL_EXCEPTION); } else if ("MySQL-AB JDBC Driver".equals(driverName) || "MySQL Connector Java".equals(driverName)) { driverBugs.add(Bug.RESULT_SET_STREAMING_ONLY_IF_FETCH_SIZE_IS_MIN_VALUE); } // TODO append the oracle dirver return driverBugs; }
From source file:com.quinsoft.zeidon.standardoe.WriteOiToXmlStream.java
WriteOiToXmlStream(ViewImpl view, Writer writer, EnumSet<WriteOiFlags> control) { this.view = view; this.writer = writer; this.control = control == null ? EnumSet.noneOf(WriteOiFlags.class) : control; incremental = this.control.contains(WriteOiFlags.fINCREMENTAL); }
From source file:org.simbasecurity.core.event.EventServiceTest.java
@Before public void setUp() throws Exception { when(ruleChangedInterestListener.getTypesOfInterest()).thenReturn(EnumSet.of(SimbaEventType.RULE_CHANGED)); when(noInterestListener.getTypesOfInterest()).thenReturn(EnumSet.noneOf(SimbaEventType.class)); eventService.postProcessAfterInitialization(ruleChangedInterestListener, "ruleChangedInterest"); eventService.postProcessAfterInitialization(noInterestListener, "noInterest"); }
From source file:com.quinsoft.zeidon.ActivateFlags.java
/** * Deserialize a string into an EnumSet<ActivateFlags> * * @param str/*from w w w. ja va 2s.c om*/ * @return */ public static EnumSet<ActivateFlags> deserialize(String str) { EnumSet<ActivateFlags> returnSet = EnumSet.noneOf(ActivateFlags.class); String[] tokens = str.split("[\\[\\], ]"); for (String token : tokens) { if (StringUtils.isBlank(token)) continue; try { returnSet.add(ActivateFlags.valueOf(token)); } catch (Exception e) { throw ZeidonException.wrapException(e).appendMessage("String = '%s'", token); } } return returnSet; }
From source file:ch.jeda.platform.android.SensorManager.java
SensorManager() { this.enabledSensors = EnumSet.noneOf(SensorType.class); this.sensorMap = new EnumMap<SensorType, Sensor>(SensorType.class); this.sensorListenerMap = new EnumMap<SensorType, SensorEventListener>(SensorType.class); this.sensorInfoMap = new HashMap<Sensor, SensorInfo>(); this.setRetainInstance(true); }
From source file:ch.digitalfondue.jfiveparse.TreeConstructionTest.java
@Test public void check() { Set<Option> options = EnumSet.noneOf(Option.class); if (!scripting) { options.add(Option.SCRIPTING_DISABLED); }//from www .j a v a2s .co m Parser parser = new Parser(options); if (treeTest.isDocumentFragment) { List<Node> nodes = parser.parseFragment(new Element(treeTest.documentFragmentElement, treeTest.documentFragmentNamespace, TreeConstructor.emptyAttrs()), treeTest.data); String rendered = renderNodes(nodes); Assert.assertEquals(treeTest.document, rendered); } else { Document document = parser.parse(treeTest.data); String rendered = renderDocument(document); Assert.assertEquals(treeTest.document, rendered); } }
From source file:org.n52.geolabel.server.StaticLabelIT.java
@Test public void testStaticNoFactesAvailable() throws MalformedURLException, IOException, XpathException, SAXException { String noAvailableSVG = getServerResourceAsString("00000000.svg?size=100"); performCommonLabelChecks(noAvailableSVG, 100); performFacetChecks(noAvailableSVG, EnumSet.noneOf(Facet.class)); }