Skip to content

Commit c4bc7f7

Browse files
Add CollectionEntry domain class and parametrise Respondent type
1 parent 018a151 commit c4bc7f7

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ Package offers base domain classes for standardised case data structures such as
2424
Assuming that you have Java project scaffolding please include framework artifact as a project dependency by adding following line:
2525

2626
```groovy
27-
compile group: 'uk.gov.hmcts.reform.ccd-case-migration', name: 'processor', version: '2.0.0'
27+
compile group: 'uk.gov.hmcts.reform.ccd-case-migration', name: 'processor', version: '2.1.0'
2828
```
2929

3030
If you want to take advantages of standard domain classes please also include domain artifact as a project dependency by adding following line:
3131

3232
```groovy
33-
compile group: 'uk.gov.hmcts.reform.ccd-case-migration', name: 'domain', version: '2.0.0'
33+
compile group: 'uk.gov.hmcts.reform.ccd-case-migration', name: 'domain', version: '2.1.0'
3434
```
3535

3636
Having done above please create class that implements `uk.gov.hmcts.reform.migration.service.DataMigrationService` interface in similar way as shown below:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ subprojects {
1111
apply plugin: 'com.jfrog.bintray'
1212

1313
group = 'uk.gov.hmcts.reform.ccd-case-migration'
14-
version = '2.0.0'
14+
version = '2.1.0'
1515

1616
sourceCompatibility = '11'
1717
targetCompatibility = '11'

modules/domain/src/main/java/uk/gov/hmcts/reform/domain/Respondent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@Data
99
@Builder
1010
@AllArgsConstructor
11-
public class Respondent {
12-
private final Party party;
11+
public class Respondent<PARTY extends Party> {
12+
private final PARTY party;
1313
private final String leadRespondentIndicator;
1414
}
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package uk.gov.hmcts.reform.domain.common;
22

3-
import com.fasterxml.jackson.annotation.JsonCreator;
43
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import lombok.AllArgsConstructor;
55
import lombok.Builder;
66
import lombok.Data;
77

88
@Data
99
@Builder
10+
@AllArgsConstructor
1011
public class Address {
1112
@JsonProperty("AddressLine1")
1213
private final String addressLine1;
@@ -22,21 +23,4 @@ public class Address {
2223
private final String postcode;
2324
@JsonProperty("Country")
2425
private final String country;
25-
26-
@JsonCreator
27-
public Address(@JsonProperty("AddressLine1") final String addressLine1,
28-
@JsonProperty("AddressLine2") final String addressLine2,
29-
@JsonProperty("AddressLine3") final String addressLine3,
30-
@JsonProperty("PostTown") final String postTown,
31-
@JsonProperty("County") final String county,
32-
@JsonProperty("PostCode") final String postcode,
33-
@JsonProperty("Country") final String country) {
34-
this.addressLine1 = addressLine1;
35-
this.addressLine2 = addressLine2;
36-
this.addressLine3 = addressLine3;
37-
this.postTown = postTown;
38-
this.county = county;
39-
this.postcode = postcode;
40-
this.country = country;
41-
}
4226
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package uk.gov.hmcts.reform.domain.common;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Builder;
5+
import lombok.Data;
6+
7+
@Data
8+
@Builder
9+
@AllArgsConstructor
10+
public class CollectionEntry<T> {
11+
private final String id;
12+
private final T value;
13+
}

0 commit comments

Comments
 (0)