Misc housekeeping
This commit is contained in:
parent
c6c1e1419e
commit
4e2c24642f
2 changed files with 8 additions and 8 deletions
|
|
@ -101,7 +101,7 @@ nippy/stress-data
|
||||||
:uuid (java.util.UUID/randomUUID)
|
:uuid (java.util.UUID/randomUUID)
|
||||||
:date (java.util.Date.)
|
:date (java.util.Date.)
|
||||||
|
|
||||||
:stress-record (->StressRecord "data")
|
:stress-record (StressRecord. "data")
|
||||||
|
|
||||||
;; Serializable
|
;; Serializable
|
||||||
:throwable (Throwable. "Yolo")
|
:throwable (Throwable. "Yolo")
|
||||||
|
|
@ -152,9 +152,9 @@ There's two default forms of encryption on offer: `:salted` and `:cached`. Each
|
||||||
|
|
||||||
(nippy/extend-thaw :my-type/foo ; Same type id
|
(nippy/extend-thaw :my-type/foo ; Same type id
|
||||||
[data-input]
|
[data-input]
|
||||||
(->MyType (.readUTF data-input)))
|
(MyType. (.readUTF data-input)))
|
||||||
|
|
||||||
(nippy/thaw (nippy/freeze (->MyType "Joe"))) => #taoensso.nippy.MyType{:data "Joe"}
|
(nippy/thaw (nippy/freeze (MyType. "Joe"))) => #taoensso.nippy.MyType{:data "Joe"}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
|
||||||
|
|
@ -1368,10 +1368,10 @@
|
||||||
(defmacro extend-thaw
|
(defmacro extend-thaw
|
||||||
"Extends Nippy to support thawing of a custom type with given id:
|
"Extends Nippy to support thawing of a custom type with given id:
|
||||||
(extend-thaw :foo/my-type [data-input] ; Keyword id
|
(extend-thaw :foo/my-type [data-input] ; Keyword id
|
||||||
(->MyType (.readUTF data-input)))
|
(MyType. (.readUTF data-input)))
|
||||||
;; or
|
;; or
|
||||||
(extend-thaw 1 [data-input] ; Byte id
|
(extend-thaw 1 [data-input] ; Byte id
|
||||||
(->MyType (.readUTF data-input)))"
|
(MyType. (.readUTF data-input)))"
|
||||||
[custom-type-id [in] & body]
|
[custom-type-id [in] & body]
|
||||||
(assert-custom-type-id custom-type-id)
|
(assert-custom-type-id custom-type-id)
|
||||||
`(do
|
`(do
|
||||||
|
|
@ -1389,8 +1389,8 @@
|
||||||
*custom-readers*
|
*custom-readers*
|
||||||
(defrecord MyType [data])
|
(defrecord MyType [data])
|
||||||
(extend-freeze MyType 1 [x out] (.writeUTF out (:data x)))
|
(extend-freeze MyType 1 [x out] (.writeUTF out (:data x)))
|
||||||
(extend-thaw 1 [in] (->MyType (.readUTF in)))
|
(extend-thaw 1 [in] (MyType. (.readUTF in)))
|
||||||
(thaw (freeze (->MyType "Joe"))))
|
(thaw (freeze (MyType. "Joe"))))
|
||||||
|
|
||||||
;;;; Stress data
|
;;;; Stress data
|
||||||
|
|
||||||
|
|
@ -1452,7 +1452,7 @@
|
||||||
:uuid (java.util.UUID/randomUUID)
|
:uuid (java.util.UUID/randomUUID)
|
||||||
:date (java.util.Date.)
|
:date (java.util.Date.)
|
||||||
|
|
||||||
:stress-record (->StressRecord "data")
|
:stress-record (StressRecord. "data")
|
||||||
|
|
||||||
;; Serializable
|
;; Serializable
|
||||||
:throwable (Throwable. "Yolo")
|
:throwable (Throwable. "Yolo")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue