Download JAR files tagged by attribute with all dependencies
tabuAndScatterSearch from group nz.ac.waikato.cms.weka (version 1.0.2)
Search methods contributed by Adrian Pino (ScatterSearchV1, TabuSearch). ScatterSearch: Performs an Scatter Search through the space of attribute subsets. Start with a population of many significants and diverses subset stops when the result is higher than a given treshold or there's not more improvement. For more information see: Felix Garcia Lopez (2004). Solving feature subset selection problem by a Parallel Scatter Search. Elsevier. Tabu Search: Abdel-Rahman Hedar, Jue Wangy, Masao Fukushima (2006). Tabu Search for Attribute Reduction in Rough Set Theory.
Group: nz.ac.waikato.cms.weka Artifact: tabuAndScatterSearch
Show all versions Show documentation Show source
Show all versions Show documentation Show source
1 downloads
Artifact tabuAndScatterSearch
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/tabuAndScatterSearch
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.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/tabuAndScatterSearch
License GNU General Public License 3
Dependencies amount 1
Dependencies weka-dev,
There are maybe transitive dependencies!
linearForwardSelection from group nz.ac.waikato.cms.weka (version 1.0.2)
Extension of BestFirst. Takes a restricted number of k attributes into account. Fixed-set selects a fixed number k of attributes, whereas k is increased in each step when fixed-width is selected. The search uses either the initial ordering to select the top k attributes, or performs a ranking (with the same evalutator the search uses later on). The search direction can be forward, or floating forward selection (with opitional backward search steps). For more information see: Martin Guetlein (2006). Large Scale Attribute Selection Using Wrappers. Freiburg, Germany.
Group: nz.ac.waikato.cms.weka Artifact: linearForwardSelection
Show all versions Show documentation Show source
Show all versions Show documentation Show source
0 downloads
Artifact linearForwardSelection
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/linearForwardSelection
License GNU General Public License 3
Dependencies amount 2
Dependencies weka-dev, classifierBasedAttributeSelection,
There are maybe transitive dependencies!
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/linearForwardSelection
License GNU General Public License 3
Dependencies amount 2
Dependencies weka-dev, classifierBasedAttributeSelection,
There are maybe transitive dependencies!
lazyBayesianRules from group nz.ac.waikato.cms.weka (version 1.0.2)
Lazy Bayesian Rules Classifier. The naive Bayesian classifier provides a simple and effective approach to classifier learning, but its attribute independence assumption is often violated in the real world. Lazy Bayesian Rules selectively relaxes the independence assumption, achieving lower error rates over a range of learning tasks. LBR defers processing to classification time, making it a highly efficient and accurate classification algorithm when small numbers of objects are to be classified. For more information, see: Zijian Zheng, G. Webb (2000). Lazy Learning of Bayesian Rules. Machine Learning. 4(1):53-84.
Group: nz.ac.waikato.cms.weka Artifact: lazyBayesianRules
Show all versions Show documentation Show source
Show all versions Show documentation Show source
0 downloads
Artifact lazyBayesianRules
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/lazyBayesianRules
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.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/lazyBayesianRules
License GNU General Public License 3
Dependencies amount 1
Dependencies weka-dev,
There are maybe transitive dependencies!
struts-el from group struts (version 1.2.9)
This subproject is an extension of the Struts tag library. Each JSP custom tag
in this library is a subclass of an associated tag in the Struts tag library.
One difference is that this tag library does not use "rtexprvalues", it uses
the expression evaluation engine in the Jakarta Taglibs implementation of the
JSP Standard Tag Library (version 1.0) to evaluate attribute values.
In addition, some of the Struts tags were not ported to this library, as it was
determined that their functionality was entirely supplied by the JSTL. These
particular Struts tags, and the reason for their non-porting will be described
in the documentation for this library.
In order to fully understand the correct utilization of this library, you must
understand the use and operation of the Struts tag library, and the use and
operation of the JavaServer Pages Standard Tag Library (hereafter called the
"JSTL"), along with the expression language (sometimes called the "EL") used
for evaluating attribute values.
Artifact struts-el
Group struts
Version 1.2.9
Last update 23. March 2006
Organization not specified
URL http://jakarta.apache.org/
License not specified
Dependencies amount 4
Dependencies standard, jstl, struts, commons-logging,
There are maybe transitive dependencies!
Group struts
Version 1.2.9
Last update 23. March 2006
Organization not specified
URL http://jakarta.apache.org/
License not specified
Dependencies amount 4
Dependencies standard, jstl, struts, commons-logging,
There are maybe transitive dependencies!
multiLayerPerceptrons from group nz.ac.waikato.cms.weka (version 1.0.10)
This package currently contains classes for training multilayer perceptrons with one hidden layer, where the number of hidden units is user specified. MLPClassifier can be used for classification problems and MLPRegressor is the corresponding class for numeric prediction tasks. The former has as many output units as there are classes, the latter only one output unit. Both minimise a penalised squared error with a quadratic penalty on the (non-bias) weights, i.e., they implement "weight decay", where this penalised error is averaged over all training instances. The size of the penalty can be determined by the user by modifying the "ridge" parameter to control overfitting. The sum of squared weights is multiplied by this parameter before added to the squared error. Both classes use BFGS optimisation by default to find parameters that correspond to a local minimum of the error function. but optionally conjugated gradient descent is available, which can be faster for problems with many parameters. Logistic functions are used as the activation functions for all units apart from the output unit in MLPRegressor, which employs the identity function. Input attributes are standardised to zero mean and unit variance. MLPRegressor also rescales the target attribute (i.e., "class") using standardisation. All network parameters are initialised with small normally distributed random values.
Group: nz.ac.waikato.cms.weka Artifact: multiLayerPerceptrons
Show all versions Show documentation Show source
Show all versions Show documentation Show source
10 downloads
Artifact multiLayerPerceptrons
Group nz.ac.waikato.cms.weka
Version 1.0.10
Last update 31. October 2016
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/multiLayerPerceptrons
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 31. October 2016
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/multiLayerPerceptrons
License GNU General Public License 3
Dependencies amount 1
Dependencies weka-dev,
There are maybe transitive dependencies!
EasyConfig from group net.sf.ssg.tools (version 0.1)
EasyConfig provides simple way to overview and apply settings to file or folder based collections of files.
Synonyms to "setting" are property, attribute, value while throughout application "setting" is used.
The settings are groupped in "configuration" that is collection of settings from various sources.
Main design concepts are:
* minimalistic way to describe configuration
* pluggable support for data types (validation), setting sources, source handlers
Sample use case:
An application is deployed in multiple locations.
We need to quickly check key settings/parameters and optionally modify some of them.
These values are located in different places:
- in files directly in file structure
- in files inside archive files (optionally nested archives)
- values in DB tables
- values accessible via URLs
- other sources (just guessed: SSH/telnet connection+some command(s), UPnP devices, proprietary protocols, etc)
We gather info from any supported (extendable) source and can modify and apply changes if supported by source
(e.g. we can't update value that is count of rows in DB table, but we can read that value).
Artifact EasyConfig
Group net.sf.ssg.tools
Version 0.1
Last update 01. February 2013
Organization not specified
URL http://sourceforge.net/p/easyconfig
License The Apache Software License, Version 2.0
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!
Group net.sf.ssg.tools
Version 0.1
Last update 01. February 2013
Organization not specified
URL http://sourceforge.net/p/easyconfig
License The Apache Software License, Version 2.0
Dependencies amount 0
Dependencies No dependencies
There are maybe transitive dependencies!
raceSearch from group nz.ac.waikato.cms.weka (version 1.0.2)
Races the cross validation error of competing attribute subsets. Use in conjuction with a ClassifierSubsetEval. RaceSearch has four modes:
forward selection races all single attribute additions to a base set (initially no attributes), selects the winner to become the new base set and then iterates until there is no improvement over the base set.
Backward elimination is similar but the initial base set has all attributes included and races all single attribute deletions.
Schemata search is a bit different. Each iteration a series of races are run in parallel. Each race in a set determines whether a particular attribute should be included or not---ie the race is between the attribute being "in" or "out". The other attributes for this race are included or excluded randomly at each point in the evaluation. As soon as one race has a clear winner (ie it has been decided whether a particular attribute should be inor not) then the next set of races begins, using the result of the winning race from the previous iteration as new base set.
Rank race first ranks the attributes using an attribute evaluator and then races the ranking. The race includes no attributes, the top ranked attribute, the top two attributes, the top three attributes, etc.
It is also possible to generate a raked list of attributes through the forward racing process. If generateRanking is set to true then a complete forward race will be run---that is, racing continues until all attributes have been selected. The order that they are added in determines a complete ranking of all the attributes.
Racing uses paired and unpaired t-tests on cross-validation errors of competing subsets. When there is a significant difference between the means of the errors of two competing subsets then the poorer of the two can be eliminated from the race. Similarly, if there is no significant difference between the mean errors of two competing subsets and they are within some threshold of each other, then one can be eliminated from the race.
0 downloads
Artifact raceSearch
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/raceSearch
License GNU General Public License 3
Dependencies amount 2
Dependencies weka-dev, classifierBasedAttributeSelection,
There are maybe transitive dependencies!
Group nz.ac.waikato.cms.weka
Version 1.0.2
Last update 26. April 2012
Organization University of Waikato, Hamilton, NZ
URL http://weka.sourceforge.net/doc.packages/raceSearch
License GNU General Public License 3
Dependencies amount 2
Dependencies weka-dev, classifierBasedAttributeSelection,
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!
Page 17 from 3 (items total 183)