Exemplo n.º 1
0
 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;
 }
Exemplo n.º 3
0
 /** {@inheritDoc} */
 @Override
 @SuppressWarnings("unchecked")
 public boolean remove(final Object o) {
   return collection.remove(funcNtoM.apply((N) o));
 }
Exemplo n.º 4
0
 /** {@inheritDoc} */
 @Override
 public boolean add(final N e) {
   return collection.add(funcNtoM.apply(e));
 }