This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-24
Channels
- # announcements (2)
- # beginners (22)
- # cider (10)
- # clojure (47)
- # clojure-italy (2)
- # clojure-spec (2)
- # clojure-uk (1)
- # clojurebridge (5)
- # clojurescript (19)
- # cursive (1)
- # data-science (7)
- # datomic (2)
- # duct (18)
- # emacs (6)
- # figwheel-main (2)
- # java (2)
- # luminus (1)
- # nrepl (20)
- # off-topic (69)
- # om (3)
- # pathom (45)
- # quil (2)
- # re-frame (16)
- # reagent (1)
- # reitit (6)
- # ring (2)
- # shadow-cljs (33)
- # tools-deps (9)
- # vim (6)
- # yada (1)
Trying to do some java interop with https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java#L139 - the create
method with a byte array.
I have in my repl:
user=> (->> s r/reflect :members
(filter #(instance? clojure.reflect.Method %))
(filter #(:public (:flags %)))
(filter #(= (str (:name %)) "create"))
(print-table [:name :flags :parameter-types]))
| :name | :flags | :parameter-types |
|--------+---------------------+------------------------------------------------------------------------------------------------------------|
| create | #{:varargs :public} | [com.google.cloud.storage.BlobInfo byte<> com.google.cloud.storage.Storage$BlobTargetOption<>] |
(There are others, but this appears the most relevant.)
Also:
user=> s
#object[com.google.cloud.storage.StorageImpl 0x57fb59c8 "[email protected]"]
user=> blob-info
#object[com.google.cloud.storage.BlobInfo$BuilderImpl 0x1e8ce729 "[email protected]"]
user=> b
#whidbey/bin "SEVZIE1ZIEdVWQ=="
But when I go to call .create
, I get:
user=> (.create s blob-info (bytes b))
java.lang.IllegalArgumentException: No matching method create found taking 2 args for class com.google.cloud.storage.StorageImpl
If I try to add nil
as the 3rd argument, I get the same error with 3 args
.
Am I missing something obvious here?It's variadic. In Java that means it takes an array of the type.