Download JAR files tagged by approaches with all dependencies
multiInstanceFilters from group nz.ac.waikato.cms.weka (version 1.0.10)
A collection of filters for manipulating multi-instance data. Includes PropositionalToMultiInstance, MultiInstanceToPropositional, MILESFilter and RELAGGS. For more information see:
M.-A. Krogel, S. Wrobel: Facets of Aggregation Approaches to Propositionalization. In: Work-in-Progress Track at the Thirteenth International Conference on Inductive Logic Programming (ILP), 2003.
Y. Chen, J. Bi, J.Z. Wang (2006). MILES: Multiple-instance learning via embedded instance selection. IEEE PAMI. 28(12):1931-1947.
James Foulds, Eibe Frank: Revisiting multiple-instance learning via embedded instance selection. In: 21st Australasian Joint Conference on Artificial Intelligence, 300-310, 2008.
Group: nz.ac.waikato.cms.weka Artifact: multiInstanceFilters
Show all versions Show documentation Show source
Show all versions Show documentation Show source
1 downloads
Artifact multiInstanceFilters
Group nz.ac.waikato.cms.weka
Version 1.0.10
Last update 23. November 2018
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/multiInstanceFilters
License GNU General Public License 3
Dependencies amount 1
Dependencies weka-dev,
There are maybe transitive dependencies!
Group nz.ac.waikato.cms.weka
Version 1.0.10
Last update 23. November 2018
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/multiInstanceFilters
License GNU General Public License 3
Dependencies amount 1
Dependencies weka-dev,
There are maybe transitive dependencies!
simplelogicdeductive from group net.sf.tweety.arg (version 1.10)
Artifact simplelogicdeductive
Group net.sf.tweety.arg
Version 1.10
Last update 16. January 2018
Organization not specified
URL Not specified
License not specified
Dependencies amount 3
Dependencies deductive, dung, org.ow2.sat4j.core,
There are maybe transitive dependencies!
Group net.sf.tweety.arg
Version 1.10
Last update 16. January 2018
Organization not specified
URL Not specified
License not specified
Dependencies amount 3
Dependencies deductive, dung, org.ow2.sat4j.core,
There are maybe transitive dependencies!
el from group net.sf.tweety.logics (version 1.10)
0 downloads
Artifact el
Group net.sf.tweety.logics
Version 1.10
Last update 16. January 2018
Organization not specified
URL Not specified
License not specified
Dependencies amount 1
Dependencies fol,
There are maybe transitive dependencies!
Group net.sf.tweety.logics
Version 1.10
Last update 16. January 2018
Organization not specified
URL Not specified
License not specified
Dependencies amount 1
Dependencies fol,
There are maybe transitive dependencies!
sspace-wordsi from group edu.ucla.sspace (version 2.0)
The S-Space Package is a collection of algorithms for building
Semantic Spaces as well as a highly-scalable library for designing new
distributional semantics algorithms. Distributional algorithms process text
corpora and represent the semantic for words as high dimensional feature
vectors. This package also includes matrices, vectors, and numerous
clustering algorithms. These approaches are known by many names, such as
word spaces, semantic spaces, or distributed semantics and rest upon the
Distributional Hypothesis: words that appear in similar contexts have
similar meanings.
Artifact sspace-wordsi
Group edu.ucla.sspace
Version 2.0
Last update 23. May 2012
Organization not specified
URL http://fozziethebeat.github.com/S-Space
License GNU General Public License 2
Dependencies amount 4
Dependencies commons-math, trove4j, netlib-java, arpack_combined_all,
There are maybe transitive dependencies!
Group edu.ucla.sspace
Version 2.0
Last update 23. May 2012
Organization not specified
URL http://fozziethebeat.github.com/S-Space
License GNU General Public License 2
Dependencies amount 4
Dependencies commons-math, trove4j, netlib-java, arpack_combined_all,
There are maybe transitive dependencies!
toolbox-utils from group de.uni_leipzig.asv.toolbox (version 1.0)
ASV Toolbox is a modular collection of tools for the exploration of written language data. They work either on word lists or text and solve several linguistic classification and clustering tasks. The topics covered contain language detection, POS-tagging, base form reduction, named entity recognition, and terminology extraction. On a more abstract level, the algorithms deal with various kinds of word similarity, using pattern based and statistical approaches. The collection can be used to work on large real world data sets as well as for studying the underlying algorithms. The ASV Toolbox can work on plain text files and connect to a MySQL database. While it is especially designed to work with corpora of the Leipzig Corpora Collection, it can easily be adapted to other sources.
Artifact toolbox-utils
Group de.uni_leipzig.asv.toolbox
Version 1.0
Last update 13. August 2013
Organization not specified
URL http://wortschatz.uni-leipzig.de/~cbiemann/software/toolbox/
License MIT License
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!
Group de.uni_leipzig.asv.toolbox
Version 1.0
Last update 13. August 2013
Organization not specified
URL http://wortschatz.uni-leipzig.de/~cbiemann/software/toolbox/
License MIT License
Dependencies amount 0
Dependencies No dependencies
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("a1") # choose the method that is valid for arrays
.stringValue("a2") # 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("foo", "Foo") # choose the method that is valid for objects
.closeObject() # close the object and we'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'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'll find out at runtime if you'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'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'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) -> {
o.stringValue("foo", "Foo"); # an attribute
o.stringValue("bar", "Bar"); # an attribute
o.object("tar", (tarObject) -> { # an attribute with a nested object
tarObject.stringValue("a", "A"); # attribute of the nested object
tarObject.stringValue("b", "B"); # attribute of the nested object
})
});
```
## Installation
### Maven
```
<dependency>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-consumer-java8</artifactId>
<version>${pact.version}</version>
</dependency>
```
## 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("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonArray((a) -> {
a.stringValue("a1");
a.stringValue("a2");
}).build());
```
### Response body as json object
```java
import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody;
...
PactDslWithProvider builder = ...
builder.given("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).build());
```
### Examples
#### Simple Json object
When creating simple json structures the difference between the two approaches isn't big.
##### JSON
```json
{
"bar": "Bar",
"foo": "Foo"
}
```
##### Pact DSL
```java
new PactDslJsonBody()
.stringValue("foo", "Foo")
.stringValue("bar", "Bar")
```
##### Lambda DSL
```java
newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).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
[
["a1", "a2"],
[1, 2],
[{"foo": "Foo"}]
]
```
##### Pact DSL
```java
new PactDslJsonArray()
.array()
.stringValue("a1")
.stringValue("a2")
.closeArray()
.array()
.numberValue(1)
.numberValue(2)
.closeArray()
.array()
.object()
.stringValue("foo", "Foo")
.closeObject()
.closeArray()
```
##### Lambda DSL
```java
newJsonArray((rootArray) -> {
rootArray.array((a) -> a.stringValue("a1").stringValue("a2"));
rootArray.array((a) -> a.numberValue(1).numberValue(2));
rootArray.array((a) -> a.object((o) -> o.stringValue("foo", "Foo"));
}).build()
```
Group: au.com.dius Artifact: pact-jvm-consumer-java8_2.12
Show all versions Show documentation Show source
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 9
Dependencies kotlin-stdlib-jre8, kotlin-reflect, slf4j-api, groovy-all, kotlin-logging, scala-library, scala-compiler, scala-logging_2.12, pact-jvm-consumer-junit_2.12,
There are maybe transitive dependencies!
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 9
Dependencies kotlin-stdlib-jre8, kotlin-reflect, slf4j-api, groovy-all, kotlin-logging, scala-library, scala-compiler, scala-logging_2.12, pact-jvm-consumer-junit_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("a1") # choose the method that is valid for arrays
.stringValue("a2") # 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("foo", "Foo") # choose the method that is valid for objects
.closeObject() # close the object and we'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'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'll find out at runtime if you'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'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'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) -> {
o.stringValue("foo", "Foo"); # an attribute
o.stringValue("bar", "Bar"); # an attribute
o.object("tar", (tarObject) -> { # an attribute with a nested object
tarObject.stringValue("a", "A"); # attribute of the nested object
tarObject.stringValue("b", "B"); # attribute of the nested object
})
});
```
## Installation
### Maven
```
<dependency>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-consumer-java8_2.12</artifactId>
<version>${pact.version}</version>
</dependency>
```
## 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("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonArray((a) -> {
a.stringValue("a1");
a.stringValue("a2");
}).build());
```
### Response body as json object
```java
import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody;
...
PactDslWithProvider builder = ...
builder.given("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).build());
```
### Examples
#### Simple Json object
When creating simple json structures the difference between the two approaches isn't big.
##### JSON
```json
{
"bar": "Bar",
"foo": "Foo"
}
```
##### Pact DSL
```java
new PactDslJsonBody()
.stringValue("foo", "Foo")
.stringValue("bar", "Bar")
```
##### Lambda DSL
```java
newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).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
[
["a1", "a2"],
[1, 2],
[{"foo": "Foo"}]
]
```
##### Pact DSL
```java
new PactDslJsonArray()
.array()
.stringValue("a1")
.stringValue("a2")
.closeArray()
.array()
.numberValue(1)
.numberValue(2)
.closeArray()
.array()
.object()
.stringValue("foo", "Foo")
.closeObject()
.closeArray();
```
##### Lambda DSL
```java
newJsonArray((rootArray) -> {
rootArray.array((a) -> a.stringValue("a1").stringValue("a2"));
rootArray.array((a) -> a.numberValue(1).numberValue(2));
rootArray.array((a) -> a.object((o) -> o.stringValue("foo", "Foo")));
}).build();
```
##### Kotlin Lambda DSL
```kotlin
newJsonArray {
newArray {
stringValue("a1")
stringValue("a2")
}
newArray {
numberValue(1)
numberValue(2)
}
newArray {
newObject { stringValue("foo", "Foo") }
}
}
```
Group: au.com.dius Artifact: pact-jvm-consumer-java8
Show all versions Show documentation Show source
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!
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("a1") # choose the method that is valid for arrays
.stringValue("a2") # 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("foo", "Foo") # choose the method that is valid for objects
.closeObject() # close the object and we'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'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'll find out at runtime if you'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'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'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) -> {
o.stringValue("foo", "Foo"); # an attribute
o.stringValue("bar", "Bar"); # an attribute
o.object("tar", (tarObject) -> { # an attribute with a nested object
tarObject.stringValue("a", "A"); # attribute of the nested object
tarObject.stringValue("b", "B"); # attribute of the nested object
})
});
```
## Installation
### Maven
```
<dependency>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-consumer-java8</artifactId>
<version>${pact.version}</version>
</dependency>
```
## 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("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonArray((a) -> {
a.stringValue("a1");
a.stringValue("a2");
}).build());
```
### Response body as json object
```java
import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody;
...
PactDslWithProvider builder = ...
builder.given("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).build());
```
### Examples
#### Simple Json object
When creating simple json structures the difference between the two approaches isn't big.
##### JSON
```json
{
"bar": "Bar",
"foo": "Foo"
}
```
##### Pact DSL
```java
new PactDslJsonBody()
.stringValue("foo", "Foo")
.stringValue("bar", "Bar")
```
##### Lambda DSL
```java
newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).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
[
["a1", "a2"],
[1, 2],
[{"foo": "Foo"}]
]
```
##### Pact DSL
```java
new PactDslJsonArray()
.array()
.stringValue("a1")
.stringValue("a2")
.closeArray()
.array()
.numberValue(1)
.numberValue(2)
.closeArray()
.array()
.object()
.stringValue("foo", "Foo")
.closeObject()
.closeArray()
```
##### Lambda DSL
```java
newJsonArray((rootArray) -> {
rootArray.array((a) -> a.stringValue("a1").stringValue("a2"));
rootArray.array((a) -> a.numberValue(1).numberValue(2));
rootArray.array((a) -> a.object((o) -> o.stringValue("foo", "Foo"));
}).build()
```
Group: au.com.dius Artifact: pact-jvm-consumer-java8_2.11
Show all versions Show documentation Show source
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-jre8, 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!
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-jre8, 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!
java8 from group au.com.dius.pact.consumer (version 4.1.43)
# pact-jvm-consumer-java8
Provides a Java8 lambda based DSL for use with Junit to build consumer tests.
## Dependency
The library is available on maven central using:
* group-id = `au.com.dius.pact.consumer`
* artifact-id = `java8`
* version-id = `4.1.x`
# A Lambda DSL for Pact
This is an extension for the pact DSL provided by [consumer](../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("a1") # choose the method that is valid for arrays
.stringValue("a2") # 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("foo", "Foo") # choose the method that is valid for objects
.closeObject() # close the object and we'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'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'll find out at runtime if you'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'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'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) -> {
o.stringValue("foo", "Foo"); # an attribute
o.stringValue("bar", "Bar"); # an attribute
o.object("tar", (tarObject) -> { # an attribute with a nested object
tarObject.stringValue("a", "A"); # attribute of the nested object
tarObject.stringValue("b", "B"); # attribute of the nested object
})
});
```
## Installation
### Maven
```
<dependency>
<groupId>au.com.dius.pact.consumer</groupId>
<artifactId>java8</artifactId>
<version>${pact.version}</version>
</dependency>
```
## 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("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonArray((a) -> {
a.stringValue("a1");
a.stringValue("a2");
}).build());
```
### Response body as json object
```java
import static io.pactfoundation.consumer.dsl.LambdaDsl.newJsonBody;
...
PactDslWithProvider builder = ...
builder.given("some state")
.uponReceiving("a request")
.path("/my-app/my-service")
.method("GET")
.willRespondWith()
.status(200)
.body(newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).build());
```
### Examples
#### Simple Json object
When creating simple json structures the difference between the two approaches isn't big.
##### JSON
```json
{
"bar": "Bar",
"foo": "Foo"
}
```
##### Pact DSL
```java
new PactDslJsonBody()
.stringValue("foo", "Foo")
.stringValue("bar", "Bar")
```
##### Lambda DSL
```java
newJsonBody((o) -> {
o.stringValue("foo", "Foo");
o.stringValue("bar", "Bar");
}).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
[
["a1", "a2"],
[1, 2],
[{"foo": "Foo"}]
]
```
##### Pact DSL
```java
new PactDslJsonArray()
.array()
.stringValue("a1")
.stringValue("a2")
.closeArray()
.array()
.numberValue(1)
.numberValue(2)
.closeArray()
.array()
.object()
.stringValue("foo", "Foo")
.closeObject()
.closeArray();
```
##### Lambda DSL
```java
newJsonArray((rootArray) -> {
rootArray.array((a) -> a.stringValue("a1").stringValue("a2"));
rootArray.array((a) -> a.numberValue(1).numberValue(2));
rootArray.array((a) -> a.object((o) -> o.stringValue("foo", "Foo")));
}).build();
```
##### Kotlin Lambda DSL
```kotlin
newJsonArray {
newArray {
stringValue("a1")
stringValue("a2")
}
newArray {
numberValue(1)
numberValue(2)
}
newArray {
newObject { stringValue("foo", "Foo") }
}
}
```
# Test Analytics
We are tracking anonymous analytics to gather important usage statistics like JVM version
and operating system. To disable tracking, set the 'pact_do_not_track' system property or environment
variable to 'true'.
0 downloads
Artifact java8
Group au.com.dius.pact.consumer
Version 4.1.43
Last update 12. July 2024
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 1
Dependencies consumer,
There are maybe transitive dependencies!
Group au.com.dius.pact.consumer
Version 4.1.43
Last update 12. July 2024
Organization not specified
URL https://github.com/DiUS/pact-jvm
License Apache 2
Dependencies amount 1
Dependencies consumer,
There are maybe transitive dependencies!
Page 17 from 3 (items total 169)