@Override public V put(final Integer key, final V value) { return put(key.intValue(), value); }
@Override public V put(final Integer key, final V value) { return put(key.intValue(), value); }
@Override public void putAll(final Map<? extends Integer, ? extends V> map) { for (final Entry<? extends Integer, ? extends V> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } }
@Override public void putAll(final Map<? extends Integer, ? extends V> map) { for (final Entry<? extends Integer, ? extends V> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } }
private void register(int factoryId, DataSerializableFactory factory) { final DataSerializableFactory current = factories.get(factoryId); if (current != null) { if (current.equals(factory)) { Logger.getLogger(getClass()).warning("DataSerializableFactory[" + factoryId + "] is already registered! Skipping " + factory); } else { throw new IllegalArgumentException("DataSerializableFactory[" + factoryId + "] is already registered! " + current + " -> " + factory); } } else { factories.put(factoryId, factory); } }
private void register(int factoryId, DataSerializableFactory factory) { final DataSerializableFactory current = factories.get(factoryId); if (current != null) { if (current.equals(factory)) { Logger.getLogger(getClass()).warning("DataSerializableFactory[" + factoryId + "] is already registered! Skipping " + factory); } else { throw new IllegalArgumentException("DataSerializableFactory[" + factoryId + "] is already registered! " + current + " -> " + factory); } } else { factories.put(factoryId, factory); } }
/** * Get a value for a given key, or if it does ot exist then default the value via a {@link IntFunction} * and put it in the map. * * @param key to search on. * @param mappingFunction to provide a value if the get returns null. * @return the value if found otherwise the default. */ public V computeIfAbsent(final int key, final IntFunction<? extends V> mappingFunction) { checkNotNull(mappingFunction, "mappingFunction cannot be null"); V value = get(key); if (value == null) { value = mappingFunction.apply(key); if (value != null) { put(key, value); } } return value; }
/** * Get a value for a given key, or if it does ot exist then default the value via a {@link IntFunction} * and put it in the map. * * @param key to search on. * @param mappingFunction to provide a value if the get returns null. * @return the value if found otherwise the default. */ public V computeIfAbsent(final int key, final IntFunction<? extends V> mappingFunction) { checkNotNull(mappingFunction, "mappingFunction cannot be null"); V value = get(key); if (value == null) { value = mappingFunction.apply(key); if (value != null) { put(key, value); } } return value; }
eventDataPerEventType.put(eventType, entryEventData); if (empty) { empty = false;
eventDataPerEventType.put(eventType, entryEventData); if (empty) { empty = false;