Skip to content

Instantly share code, notes, and snippets.

@seancorfield
Forked from johnjelinek/bad.clj
Last active Mar 20, 2020
Embed
What would you like to do?
Example of builder with map as input
(ns builderjava.bad
(:require [clojure.java.data.builder :as builder])
(:import (software.amazon.awscdk.services.apigateway IntegrationOptions
IntegrationOptions$Builder)))
(defn build []
(builder/to-java IntegrationOptions {:requestParamaters {"a" "b"}}))
(build)
;; => #object[software.amazon.awscdk.services.apigateway.IntegrationOptions$Jsii$Proxy 0x14b789f6 "software.amazon.awscdk.services.apigateway.IntegrationOptions$Jsii$Proxy@b43"]
{:deps {software.amazon.awscdk/apigateway {:mvn/version "1.30.0"}
org.clojure/java.data {:mvn/version "1.0.64"}}}
(ns builderjava.good
(:import software.amazon.awscdk.services.apigateway.IntegrationOptions))
(defn build []
(-> (IntegrationOptions/builder)
(.requestParameters {"a" "b"})
(.build)))
(build)
;; => #object[software.amazon.awscdk.services.apigateway.IntegrationOptions$Jsii$Proxy 0x4ffbb14b "software.amazon.awscdk.services.apigateway.IntegrationOptions$Jsii$Proxy@b43"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment