/** * Adds a new element to this set. * * @param e the element. * @return true if the add succeeds. * @throws DataAccessLayerException in case of data access failure. */ public boolean add(final E e) throws DataAccessLayerException { return e == null ? false : (_map.put(e, PRESENT) == null); }
/** * Adds a new element to this set. * * @param e the element. * @return true if the add succeeds. * @throws DataAccessLayerException in case of data access failure. */ public boolean add(final E e) throws DataAccessLayerException { return e == null ? false : (_map.put(e, PRESENT) == null); }
/** * Puts the given entries into this map. If a mapping already exists for a * key, it will be replaced with the new value. * * @param m the entries to insert. * @throws DataAccessLayerException in case of data access failure. */ public void putAll(final Map<? extends K, ? extends V> m) throws DataAccessLayerException { for (Map.Entry<? extends K, ? extends V> entry : m.entrySet()) { put(entry.getKey(), entry.getValue()); } }
/** * Puts the given entries into this map. If a mapping already exists for a * key, it will be replaced with the new value. * * @param m the entries to insert. * @throws DataAccessLayerException in case of data access failure. */ public void putAll(final Map<? extends K, ? extends V> m) throws DataAccessLayerException { for (Map.Entry<? extends K, ? extends V> entry : m.entrySet()) { put(entry.getKey(), entry.getValue()); } }
@Override protected void setNamespaceInternal(final String prefix, final String name) throws SailException { try { _crdf.getPrefix2Namespaces().put(prefix, name); } catch (DataAccessLayerException exception) { throw new SailException(exception); } }
@Override protected void setNamespaceInternal(final String prefix, final String name) throws SailException { try { _crdf.getPrefix2Namespaces().put(prefix, name); } catch (DataAccessLayerException exception) { throw new SailException(exception); } }
@Before public void reset() throws DataAccessLayerException { for (String key : map.keySet()) { map.remove(key); } for (Map.Entry<String, String> entry : TESTDATA1.entrySet()) { map.put(entry.getKey(), entry.getValue()); } }
@Test public void insertTest() throws DataAccessLayerException { for (String key : TESTDATA2.keySet()) { assertEquals(TESTDATA1.get(key), map.put(key, TESTDATA2.get(key))); } for (String key : TESTDATA2.keySet()) { assertEquals(TESTDATA2.get(key), map.get(key)); } }