All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Download JAR files tagged by choose with all dependencies

Search JAR files by class name

json from group com.jwebmp.jre11 (version 0.63.0.19)

JSON is a light-weight, language independent, data interchange format. See http://www.JSON.org/ The files in this package implement JSON encoders/decoders in Java. It also includes the capability to convert between JSON and XML, HTTP headers, Cookies, and CDL. This is a reference implementation. There is a large number of JSON packages in Java. Perhaps someday the Java community will standardize on one. Until then, choose carefully. The license includes this restriction: "The software shall be used for good, not evil." If your conscience cannot live with that, then choose a different package.

Group: com.jwebmp.jre11 Artifact: json
Show all versions Show documentation Show source 
 

8 downloads
Artifact json
Group com.jwebmp.jre11
Version 0.63.0.19
Last update 20. December 2018
Organization not specified
URL https://github.com/douglascrockford/JSON-java
License The JSON License
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

org.everit.osgi.bundles.org.json from group org.everit.osgi.bundles (version 1.0.0-v20140107)

JSON is a light-weight, language independent, data interchange format. See http://www.JSON.org/ The files in this package implement JSON encoders/decoders in Java. It also includes the capability to convert between JSON and XML, HTTP headers, Cookies, and CDL. This is a reference implementation. There is a large number of JSON packages in Java. Perhaps someday the Java community will standardize on one. Until then, choose carefully. The license includes this restriction: "The software shall be used for good, not evil." If your conscience cannot live with that, then choose a different package. The package compiles on Java 1.2 thru Java 1.4.

Group: org.everit.osgi.bundles Artifact: org.everit.osgi.bundles.org.json
Show documentation Show source 
 

3 downloads
Artifact org.everit.osgi.bundles.org.json
Group org.everit.osgi.bundles
Version 1.0.0-v20140107
Last update 14. February 2014
Organization not specified
URL https://github.com/douglascrockford/JSON-java
License The JSON License
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

reco4j-core from group org.reco4j (version 0.5.0)

Reco4j is an open source project aims at developing a recommendation framework based on graph data sources. We choose graph databases for several reasons. They are NoSQL databases, so "schemaless". This means that it is possible to extend the basic data structure with intermediate information, i.e. similarity value between item and so on. Moreover, since every information is expressed with properties, nodes and relations, the recommendation process can be customized to work on every graph. Reco4j can be used on every graph where "user" and "item" is represented by node and the preferences are modelled as relationship between them. Current implementation leverage on Neo4j as first graph database integrated in our framework.

Group: org.reco4j Artifact: reco4j-core
Show all versions Show documentation Show source 
 

0 downloads
Artifact reco4j-core
Group org.reco4j
Version 0.5.0
Last update 22. September 2013
Organization not specified
URL http://www.reco4j.org
License GNU General Public License, Version 3
Dependencies amount 3
Dependencies log4j, mahout-core, commons-math3,
There are maybe transitive dependencies!

appfuse-plugins from group org.appfuse (version 2.0.2)

Group: org.appfuse Artifact: appfuse-plugins
Show all versions 
There is no JAR file uploaded. A download is not possible! Please choose another version.
0 downloads
Artifact appfuse-plugins
Group org.appfuse
Version 2.0.2
Last update 11. May 2008
Organization not specified
URL Not specified
License The Apache Software License, Version 2.0
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!

maven-warpath-plugin from group org.appfuse (version 2.0.2)

Group: org.appfuse Artifact: maven-warpath-plugin
Show all versions Show documentation Show source 
 

4 downloads
Artifact maven-warpath-plugin
Group org.appfuse
Version 2.0.2
Last update 11. May 2008
Organization not specified
URL Not specified
License not specified
Dependencies amount 6
Dependencies maven-plugin-api, maven-project, maven-artifact, maven-core, plexus-utils, plexus-utils,
There are maybe transitive dependencies!

ashkay from group ashkay (version 0.6)

How many classes does it take to make a cache? 60? 80? You might think so if you look at the other caches on the market. Ashkay is a streamlined, simple cache that in many ways is more powerful than the other mainstream caches. Ashkay is a strategy based caching tool. In most cases, you might be using a configuration file to tell the cache what rules it should obey. Or, you might just be setting properties on the cache. I have never liked this model as it limits me, the user of the cache to strategies the developer decided were important. Instead, Ashkay lets you choose the strategy(ies) to use when caching certain objects. Of course, a few of the most handy strategies are pre-packaged, but implementing a new one is a simple as can be. Ashkay is a fork of <a href="http://xot.sf.net">xot</a> caching code. Made more sense on its own.

Group: ashkay Artifact: ashkay

 

0 downloads
Artifact ashkay
Group ashkay
Version 0.6
Last update 24. November 2005
Organization Apache Software Foundation
URL http://ashkay.sourceforge.net
License not specified
Dependencies amount 3
Dependencies log4j, concurrent, junit,
There are maybe transitive dependencies!

netbeans-color-codes-preview from group com.junichi11.netbeans.modules (version 0.13.4)

Show color codes preview per line in a sidebar area of an editor. <h2>Disable / Enable</h2> Check/Uncheck View > Show Colors <h2>Supported color patterns</h2> <ul> <li>Hex color code (e.g. #ffffff, #000)</li> <li>Css rgb/rgba values (e.g. rgb(0,0,0), rgba(255, 255, 255, 0.8))</li> <li>Css hsl/hsla values (e.g. hsl(0, 100%, 50%), hsla(120, 100%, 50%, 0.5))</li> <li>Named colors (e.g. red, blue)</li> <li>Java Color class (e.g. Color.black, new Color(100, 100, 100))</li> </ul> <h2>Multiple colors</h2> <ul> <li>Show top two colors in a sidebar if there are multiple colors in a line.</li> <li>If you want to check all colors, please click a specific rectangle. They will be shown as a list.</li> </ul> <h2>Change a color using the color chooser</h2> <ul> <li>Click a colored rectangle</li> <li>Click a color value of a list</li> <li>Select a new color in the color chooser</li> <li>An old color value will be changed to new one with the same format</li> </ul> <h2>Generate color codes</h2><p>You can generate color codes via a code generator(<kbd>Alt</kbd> + <kbd>Ins</kbd>).</p> <ol> <li>Run a code generator(Alt + Ins)</li> <li>Choose <code>Color...</code></li> <li>Choose format you expect (e.g. <code>new Color(r, g, b)</code>)</li> <li>Choose a color</li> <li>Click the OK button</li> <li>A color code is generated at the caret position</li> </ol> <h2>Options</h2> Tools > Options > Miscellaneous > Color Codes Preview <h3>Regex for enabled mime-types for Hex and CSS colors</h3> Default value is `^text/(x-)?(css|less|sass|scss)$`. If you would like to disable/enable some mime-types, please change the default regex. This pattern is used when the plugin checks a mime-type. <h3>Named Colors</h3> This option is `false` by default. If you would like to show named colors, please check it. <h2>NOTE</h2> <ul> <li>If you would like to show colors of `Color.decode(<hex>)` e.g. `Color.decode(#000000)`, Please add `java` to "Regex for enabled mime-types" of Hex and CSS e.g. (`^text/(x-)?(css|less|sass|scss|java)$`)</li> <li>Colors may be shown if they are not color codes. e.g. "#feature" contains #fea. This plugin recognizes it as a hex color code.</li> <li>If you use the GTK Look and Feel, you cannot change an alpha value in the color chooser.</li> <li>Hsl or hsla color values may not be changed correctly when you use the color chooser. (There may be 1% errors.)</li> </ul>

Group: com.junichi11.netbeans.modules Artifact: netbeans-color-codes-preview
Show all versions 
 

0 downloads
Artifact netbeans-color-codes-preview
Group com.junichi11.netbeans.modules
Version 0.13.4
Last update 10. October 2021
Organization not specified
URL https://github.com/junichi11/netbeans-color-codes-preview
License Apache License, Version 2.0
Dependencies amount 16
Dependencies org-netbeans-api-annotations-common, org-netbeans-modules-editor-lib2, org-netbeans-modules-editor-lib, org-openide-util, org-openide-util-ui, org-netbeans-modules-editor-mimelookup, org-openide-util-lookup, org-netbeans-modules-editor-settings, org-netbeans-modules-editor, org-openide-dialogs, org-netbeans-modules-editor-fold, org-openide-text, org-netbeans-modules-options-api, org-openide-awt, org-netbeans-modules-editor-document, org-openide-modules,
There are maybe transitive dependencies!

pact-jvm-consumer-java8_2.12 from group au.com.dius (version 3.6.15)

# pact-jvm-consumer-java8 Provides a Java8 lambda based DSL for use with Junit to build consumer tests. # A Lambda DSL for Pact This is an extension for the pact DSL provided by [pact-jvm-consumer](../pact-jvm-consumer). The difference between the default pact DSL and this lambda DSL is, as the name suggests, the usage of lambdas. The use of lambdas makes the code much cleaner. ## Why a new DSL implementation? The lambda DSL solves the following two main issues. Both are visible in the following code sample: ```java new PactDslJsonArray() .array() # open an array .stringValue(&quot;a1&quot;) # choose the method that is valid for arrays .stringValue(&quot;a2&quot;) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .numberValue(1) # choose the method that is valid for arrays .numberValue(2) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .object() # now we work with an object .stringValue(&quot;foo&quot;, &quot;Foo&quot;) # choose the method that is valid for objects .closeObject() # close the object and we&apos;re back in the array .closeArray() # close the array ``` ### The existing DSL is quite error-prone Methods may only be called in certain states. For example `object()` may only be called when you&apos;re currently working on an array whereas `object(name)` is only allowed to be called when working on an object. But both of the methods are available. You&apos;ll find out at runtime if you&apos;re using the correct method. Finally, the need for opening and closing objects and arrays makes usage cumbersome. The lambda DSL has no ambiguous methods and there&apos;s no need to close objects and arrays as all the work on such an object is wrapped in a lamda call. ### The existing DSL is hard to read When formatting your source code with an IDE the code becomes hard to read as there&apos;s no indentation possible. Of course, you could do it by hand but we want auto formatting! Auto formatting works great for the new DSL! ```java array.object((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); # an attribute o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); # an attribute o.object(&quot;tar&quot;, (tarObject) -&gt; { # an attribute with a nested object tarObject.stringValue(&quot;a&quot;, &quot;A&quot;); # attribute of the nested object tarObject.stringValue(&quot;b&quot;, &quot;B&quot;); # attribute of the nested object }) }); ``` ## Installation ### Maven ``` &lt;dependency&gt; &lt;groupId&gt;au.com.dius&lt;/groupId&gt; &lt;artifactId&gt;pact-jvm-consumer-java8_2.12&lt;/artifactId&gt; &lt;version&gt;${pact.version}&lt;/version&gt; &lt;/dependency&gt; ``` ## Usage Start with a static import of `LambdaDsl`. This class contains factory methods for the lambda dsl extension. When you come accross the `body()` method of `PactDslWithProvider` builder start using the new extensions. The call to `LambdaDsl` replaces the call to instance `new PactDslJsonArray()` and `new PactDslJsonBody()` of the pact library. ```java io.pactfoundation.consumer.dsl.LambdaDsl.* ``` ### Response body as json array ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonArray; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonArray((a) -&gt; { a.stringValue(&quot;a1&quot;); a.stringValue(&quot;a2&quot;); }).build()); ``` ### Response body as json object ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build()); ``` ### Examples #### Simple Json object When creating simple json structures the difference between the two approaches isn&apos;t big. ##### JSON ```json { &quot;bar&quot;: &quot;Bar&quot;, &quot;foo&quot;: &quot;Foo&quot; } ``` ##### Pact DSL ```java new PactDslJsonBody() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .stringValue(&quot;bar&quot;, &quot;Bar&quot;) ``` ##### Lambda DSL ```java newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build(); ``` #### An array of arrays When we come to more complex constructs with arrays and nested objects the beauty of lambdas become visible! ##### JSON ```json [ [&quot;a1&quot;, &quot;a2&quot;], [1, 2], [{&quot;foo&quot;: &quot;Foo&quot;}] ] ``` ##### Pact DSL ```java new PactDslJsonArray() .array() .stringValue(&quot;a1&quot;) .stringValue(&quot;a2&quot;) .closeArray() .array() .numberValue(1) .numberValue(2) .closeArray() .array() .object() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .closeObject() .closeArray(); ``` ##### Lambda DSL ```java newJsonArray((rootArray) -&gt; { rootArray.array((a) -&gt; a.stringValue(&quot;a1&quot;).stringValue(&quot;a2&quot;)); rootArray.array((a) -&gt; a.numberValue(1).numberValue(2)); rootArray.array((a) -&gt; a.object((o) -&gt; o.stringValue(&quot;foo&quot;, &quot;Foo&quot;))); }).build(); ``` `object` is a reserved word in Kotlin. To allow using the DSL without escaping, a Kotlin extension `newObject` is available: ```kotlin newJsonArray { rootArray -&gt; rootArray.array { a -&gt; a.stringValue(&quot;a1&quot;).stringValue(&quot;a2&quot;) } rootArray.array { a -&gt; a.numberValue(1).numberValue(2) } rootArray.array { a -&gt; a.newObject { o -&gt; o.stringValue(&quot;foo&quot;, &quot;Foo&quot;) } } }.build(); ```

Group: au.com.dius Artifact: pact-jvm-consumer-java8_2.12
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-consumer-java8_2.12
Group au.com.dius
Version 3.6.15
Last update 29. April 2020
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 1
Dependencies pact-jvm-consumer_2.12,
There are maybe transitive dependencies!

pact-jvm-consumer-java8 from group au.com.dius (version 4.0.10)

# pact-jvm-consumer-java8 Provides a Java8 lambda based DSL for use with Junit to build consumer tests. # A Lambda DSL for Pact This is an extension for the pact DSL provided by [pact-jvm-consumer](../pact-jvm-consumer). The difference between the default pact DSL and this lambda DSL is, as the name suggests, the usage of lambdas. The use of lambdas makes the code much cleaner. ## Why a new DSL implementation? The lambda DSL solves the following two main issues. Both are visible in the following code sample: ```java new PactDslJsonArray() .array() # open an array .stringValue(&quot;a1&quot;) # choose the method that is valid for arrays .stringValue(&quot;a2&quot;) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .numberValue(1) # choose the method that is valid for arrays .numberValue(2) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .object() # now we work with an object .stringValue(&quot;foo&quot;, &quot;Foo&quot;) # choose the method that is valid for objects .closeObject() # close the object and we&apos;re back in the array .closeArray() # close the array ``` ### The existing DSL is quite error-prone Methods may only be called in certain states. For example `object()` may only be called when you&apos;re currently working on an array whereas `object(name)` is only allowed to be called when working on an object. But both of the methods are available. You&apos;ll find out at runtime if you&apos;re using the correct method. Finally, the need for opening and closing objects and arrays makes usage cumbersome. The lambda DSL has no ambiguous methods and there&apos;s no need to close objects and arrays as all the work on such an object is wrapped in a lamda call. ### The existing DSL is hard to read When formatting your source code with an IDE the code becomes hard to read as there&apos;s no indentation possible. Of course, you could do it by hand but we want auto formatting! Auto formatting works great for the new DSL! ```java array.object((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); # an attribute o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); # an attribute o.object(&quot;tar&quot;, (tarObject) -&gt; { # an attribute with a nested object tarObject.stringValue(&quot;a&quot;, &quot;A&quot;); # attribute of the nested object tarObject.stringValue(&quot;b&quot;, &quot;B&quot;); # attribute of the nested object }) }); ``` ## Installation ### Maven ``` &lt;dependency&gt; &lt;groupId&gt;au.com.dius&lt;/groupId&gt; &lt;artifactId&gt;pact-jvm-consumer-java8_2.12&lt;/artifactId&gt; &lt;version&gt;${pact.version}&lt;/version&gt; &lt;/dependency&gt; ``` ## Usage Start with a static import of `LambdaDsl`. This class contains factory methods for the lambda dsl extension. When you come accross the `body()` method of `PactDslWithProvider` builder start using the new extensions. The call to `LambdaDsl` replaces the call to instance `new PactDslJsonArray()` and `new PactDslJsonBody()` of the pact library. ```java io.pactfoundation.consumer.dsl.LambdaDsl.* ``` ### Response body as json array ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonArray; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonArray((a) -&gt; { a.stringValue(&quot;a1&quot;); a.stringValue(&quot;a2&quot;); }).build()); ``` ### Response body as json object ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build()); ``` ### Examples #### Simple Json object When creating simple json structures the difference between the two approaches isn&apos;t big. ##### JSON ```json { &quot;bar&quot;: &quot;Bar&quot;, &quot;foo&quot;: &quot;Foo&quot; } ``` ##### Pact DSL ```java new PactDslJsonBody() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .stringValue(&quot;bar&quot;, &quot;Bar&quot;) ``` ##### Lambda DSL ```java newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build(); ``` #### An array of arrays When we come to more complex constructs with arrays and nested objects the beauty of lambdas become visible! ##### JSON ```json [ [&quot;a1&quot;, &quot;a2&quot;], [1, 2], [{&quot;foo&quot;: &quot;Foo&quot;}] ] ``` ##### Pact DSL ```java new PactDslJsonArray() .array() .stringValue(&quot;a1&quot;) .stringValue(&quot;a2&quot;) .closeArray() .array() .numberValue(1) .numberValue(2) .closeArray() .array() .object() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .closeObject() .closeArray(); ``` ##### Lambda DSL ```java newJsonArray((rootArray) -&gt; { rootArray.array((a) -&gt; a.stringValue(&quot;a1&quot;).stringValue(&quot;a2&quot;)); rootArray.array((a) -&gt; a.numberValue(1).numberValue(2)); rootArray.array((a) -&gt; a.object((o) -&gt; o.stringValue(&quot;foo&quot;, &quot;Foo&quot;))); }).build(); ``` ##### Kotlin Lambda DSL ```kotlin newJsonArray { newArray { stringValue(&quot;a1&quot;) stringValue(&quot;a2&quot;) } newArray { numberValue(1) numberValue(2) } newArray { newObject { stringValue(&quot;foo&quot;, &quot;Foo&quot;) } } } ```

Group: au.com.dius Artifact: pact-jvm-consumer-java8
Show all versions Show documentation Show source 
 

0 downloads
Artifact pact-jvm-consumer-java8
Group au.com.dius
Version 4.0.10
Last update 18. April 2020
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 1
Dependencies pact-jvm-consumer,
There are maybe transitive dependencies!

pact-jvm-consumer-java8_2.11 from group au.com.dius (version 3.5.24)

# pact-jvm-consumer-java8 Provides a Java8 lambda based DSL for use with Junit to build consumer tests. # A Lambda DSL for Pact This is an extension for the pact DSL provided by [pact-jvm-consumer](../pact-jvm-consumer). The difference between the default pact DSL and this lambda DSL is, as the name suggests, the usage of lambdas. The use of lambdas makes the code much cleaner. ## Why a new DSL implementation? The lambda DSL solves the following two main issues. Both are visible in the following code sample: ```java new PactDslJsonArray() .array() # open an array .stringValue(&quot;a1&quot;) # choose the method that is valid for arrays .stringValue(&quot;a2&quot;) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .numberValue(1) # choose the method that is valid for arrays .numberValue(2) # choose the method that is valid for arrays .closeArray() # close the array .array() # open an array .object() # now we work with an object .stringValue(&quot;foo&quot;, &quot;Foo&quot;) # choose the method that is valid for objects .closeObject() # close the object and we&apos;re back in the array .closeArray() # close the array ``` ### The existing DSL is quite error-prone Methods may only be called in certain states. For example `object()` may only be called when you&apos;re currently working on an array whereas `object(name)` is only allowed to be called when working on an object. But both of the methods are available. You&apos;ll find out at runtime if you&apos;re using the correct method. Finally, the need for opening and closing objects and arrays makes usage cumbersome. The lambda DSL has no ambiguous methods and there&apos;s no need to close objects and arrays as all the work on such an object is wrapped in a lamda call. ### The existing DSL is hard to read When formatting your source code with an IDE the code becomes hard to read as there&apos;s no indentation possible. Of course, you could do it by hand but we want auto formatting! Auto formatting works great for the new DSL! ```java array.object((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); # an attribute o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); # an attribute o.object(&quot;tar&quot;, (tarObject) -&gt; { # an attribute with a nested object tarObject.stringValue(&quot;a&quot;, &quot;A&quot;); # attribute of the nested object tarObject.stringValue(&quot;b&quot;, &quot;B&quot;); # attribute of the nested object }) }); ``` ## Installation ### Maven ``` &lt;dependency&gt; &lt;groupId&gt;au.com.dius&lt;/groupId&gt; &lt;artifactId&gt;pact-jvm-consumer-java8_2.12&lt;/artifactId&gt; &lt;version&gt;${pact.version}&lt;/version&gt; &lt;/dependency&gt; ``` ## Usage Start with a static import of `LambdaDsl`. This class contains factory methods for the lambda dsl extension. When you come accross the `body()` method of `PactDslWithProvider` builder start using the new extensions. The call to `LambdaDsl` replaces the call to instance `new PactDslJsonArray()` and `new PactDslJsonBody()` of the pact library. ```java io.pactfoundation.consumer.dsl.LambdaDsl.* ``` ### Response body as json array ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonArray; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonArray((a) -&gt; { a.stringValue(&quot;a1&quot;); a.stringValue(&quot;a2&quot;); }).build()); ``` ### Response body as json object ```java import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody; ... PactDslWithProvider builder = ... builder.given(&quot;some state&quot;) .uponReceiving(&quot;a request&quot;) .path(&quot;/my-app/my-service&quot;) .method(&quot;GET&quot;) .willRespondWith() .status(200) .body(newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build()); ``` ### Examples #### Simple Json object When creating simple json structures the difference between the two approaches isn&apos;t big. ##### JSON ```json { &quot;bar&quot;: &quot;Bar&quot;, &quot;foo&quot;: &quot;Foo&quot; } ``` ##### Pact DSL ```java new PactDslJsonBody() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .stringValue(&quot;bar&quot;, &quot;Bar&quot;) ``` ##### Lambda DSL ```java newJsonBody((o) -&gt; { o.stringValue(&quot;foo&quot;, &quot;Foo&quot;); o.stringValue(&quot;bar&quot;, &quot;Bar&quot;); }).build() ``` #### An array of arrays When we come to more complex constructs with arrays and nested objects the beauty of lambdas become visible! ##### JSON ```json [ [&quot;a1&quot;, &quot;a2&quot;], [1, 2], [{&quot;foo&quot;: &quot;Foo&quot;}] ] ``` ##### Pact DSL ```java new PactDslJsonArray() .array() .stringValue(&quot;a1&quot;) .stringValue(&quot;a2&quot;) .closeArray() .array() .numberValue(1) .numberValue(2) .closeArray() .array() .object() .stringValue(&quot;foo&quot;, &quot;Foo&quot;) .closeObject() .closeArray() ``` ##### Lambda DSL ```java newJsonArray((rootArray) -&gt; { rootArray.array((a) -&gt; a.stringValue(&quot;a1&quot;).stringValue(&quot;a2&quot;)); rootArray.array((a) -&gt; a.numberValue(1).numberValue(2)); rootArray.array((a) -&gt; a.object((o) -&gt; o.stringValue(&quot;foo&quot;, &quot;Foo&quot;)); }).build() ```

Group: au.com.dius Artifact: pact-jvm-consumer-java8_2.11
Show all versions Show documentation Show source 
 

3 downloads
Artifact pact-jvm-consumer-java8_2.11
Group au.com.dius
Version 3.5.24
Last update 04. November 2018
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 8
Dependencies kotlin-stdlib-jdk8, kotlin-reflect, slf4j-api, groovy-all, kotlin-logging, scala-library, scala-logging_2.11, pact-jvm-consumer-junit_2.11,
There are maybe transitive dependencies!



Page 7 from 8 (items total 72)


© 2015 - 2024 Weber Informatics LLC | Privacy Policy