code: public Long getAndDecryptLong(String name, String providerName) throws Exception {
          //let it fail in the more general case where it isn't actually a number
          Number number = (Number) getAndDecrypt(name, providerName);
          if (number == null) {
              return null;
          } else if (number instanceof Long) {
              return (Long) number;
          } else {
              return number.longValue(); //autoboxing to Long
          }
      }
docs: Retrieves the decrypted value from the field name and casts it to {@link Long}.
  
  Note that if value was stored as another numerical type, some truncation or rounding may occur.
  
  Note: Use of the Field Level Encryption functionality provided in the
  com.couchbase.client.encryption namespace provided by Couchbase is
  subject to the Couchbase Inc. Enterprise Subscription License Agreement
  at https://www.couchbase.com/ESLA-11132015.
  
  @param name the name of the field.
  @param providerName the crypto provider name for decryption
  @return the result or null if it does not exist.