java

2019-02-24T23:21:50.003800Z

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 "com.google.cloud.storage.StorageImpl@57fb59c8"]
user=> blob-info
#object[com.google.cloud.storage.BlobInfo$BuilderImpl 0x1e8ce729 "com.google.cloud.storage.BlobInfo$BuilderImpl@1e8ce729"]
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?

seancorfield 2019-02-24T23:59:32.004400Z

It's variadic. In Java that means it takes an array of the type.