code: public static AttributeType extractAttributeType(Object attributeValue) {
          if (attributeValue instanceof Portable) {
              return AttributeType.PORTABLE;
          }
          return ReflectionHelper.getAttributeType(attributeValue.getClass());
      }
docs: Deduces the {@link AttributeType} of the given non-{@code null} attribute
  value.
  
  @param attributeValue the attribute value to deduce the type of.
  @return the deduced attribute type or {@code null} if there is no
  attribute type corresponding to the type of the value. See {@link
  AttributeType} for the list of representable attribute types.