private <N> N getSingleValuedAttribute( final AttributeDescription attributeDescription, final Function<ByteString, N, NeverThrowsException> function) { final Attribute attr = entry.getAttribute(attributeDescription); if (attr == null || attr.isEmpty()) { return null; } else { return function.apply(attr.firstValue()); } }
@Override public KO getKey() { if (cachedTransformedKey == null) { try { cachedTransformedKey = keyTransformer.apply(input.getKey()); } catch (Exception e) { throw new TransformationException(e, input.getKey(), input.getValue()); } } return cachedTransformedKey; }
/** {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public boolean remove(final Object o) { return collection.remove(funcNtoM.apply((N) o)); }
/** {@inheritDoc} */ @Override public boolean add(final N e) { return collection.add(funcNtoM.apply(e)); }