Utilities for defining Pail structures.
Utilities for defining Pail structures.
(gen-structure
the-name
&
{:keys [type serializer partitioner prefix]
:or {type (class (byte-array 0))
serializer (clojure.core/seq
(clojure.core/concat
(clojure.core/list
(quote clj-pail.serializer/null-serializer))))
partitioner (clojure.core/seq
(clojure.core/concat
(clojure.core/list
(quote clj-pail.partitioner/null-partitioner))))
prefix "-"}})
Generates a class that implements PailStructure
. The PailStructure
's behavior can be
customized by providing a Serializer
or VerticalPartitioner
. The class will be named whatever
is provided for the name
parameter. (It should be specified just as it would be gen-class
.
The Serializer
and VerticalPartitioner
should be able to handle the object type specified by the
:type
option.
:type
: The object type that the PailStructure
can serialize. (Defaults to a byte array.)
:serializer
: An implementation of the Serializer
protocol, which will be used to serialize and
deserialize object. (Defaults to NullSerializer
.)
:partitioner
: An implementation of the VerticalPartitioner
protocol, which will be used to
vertically partition the data. (Defaults to NullPartitioner
.)
:prefix
: Used to specify the prefix for the generated methods, just like with gen-class
. A
prefix should be used to avoid name collisions when generating more than one class in the same
namespace. (Defaults to "-"
.)
Any namespace that uses gen-structure
should be configured to be AOT-compiled.
Generates a class that implements `PailStructure`. The `PailStructure`'s behavior can be customized by providing a `Serializer` or `VerticalPartitioner`. The class will be named whatever is provided for the `name` parameter. (It should be specified just as it would be `gen-class`. The `Serializer` and `VerticalPartitioner` should be able to handle the object type specified by the `:type` option. ### Options `:type`: The object type that the `PailStructure` can serialize. (Defaults to a byte array.) `:serializer`: An implementation of the `Serializer` protocol, which will be used to serialize and deserialize object. (Defaults to `NullSerializer`.) `:partitioner`: An implementation of the `VerticalPartitioner` protocol, which will be used to vertically partition the data. (Defaults to `NullPartitioner`.) `:prefix`: Used to specify the prefix for the generated methods, just like with `gen-class`. A prefix should be used to avoid name collisions when generating more than one class in the same namespace. (Defaults to `"-"`.) Any namespace that uses `gen-structure` should be configured to be AOT-compiled.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close