 
 ; #uuid - Universally-unique identifier string.
 
-(extend-type java.util.UUID
+(extend-type UUID
   TaggedValue
   (edn-tag [this] 'uuid)
   (edn-value [this] (str this)))


(defn- format-utc
  "Produces an ISO-8601 formatted date-time string from the given Date."
  [^java.util.Date date]
  (let [date-format (doto (java.text.SimpleDateFormat.
                            "yyyy-MM-dd'T'HH:mm:ss.SSS-00:00")
                       (.setTimeZone (java.util.TimeZone/getTimeZone "GMT")))]
    (.format date-format date)))


(extend-type java.util.Date
  TaggedValue
  (edn-tag [this] 'inst)
  (edn-value [this] (format-utc this)))

(ns vault.data
  "Code to handle structured data, usually represented as EDN."
  (:require [clojure.data.codec.base64 :as b64])
  (:import
    (java.net URI)
    (java.text SimpleDateFormat)
    (java.util Date TimeZone UUID)))


;; TOTAL-ORDERING COMPARATOR
