Пример #1
0
 private <N> Collection<N> getMultiValuedAttribute(
     final AttributeDescription attributeDescription,
     final Function<ByteString, N, NeverThrowsException> function) {
   // The returned collection is unmodifiable because we may need to
   // return an empty collection if the attribute does not exist in the
   // underlying entry. If a value is then added to the returned empty
   // collection it would require that an attribute is created in the
   // underlying entry in order to maintain consistency.
   final Attribute attr = entry.getAttribute(attributeDescription);
   if (attr != null) {
     return Collections.unmodifiableCollection(
         Collections2.transformedCollection(attr, function, Functions.objectToByteString()));
   } else {
     return Collections.emptySet();
   }
 }