Skip to content

Commit e119f27

Browse files
authored
Ignore id field in equals and hash code (#312)
* Ignore id field in equals and hashCode method * Fix wrong configuration of the annotation
1 parent 455eabc commit e119f27

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

src/main/groovy/life/qbic/datamodel/dtos/business/Affiliation.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import groovy.transform.EqualsAndHashCode
88
* @author Sven Fillinger
99
* @since 1.11.0
1010
*/
11-
@EqualsAndHashCode
11+
@EqualsAndHashCode(excludes = ["id"])
1212
final class Affiliation {
1313

1414
/**
@@ -53,10 +53,10 @@ final class Affiliation {
5353
final String country
5454

5555
/**
56-
* An affiliation category @link{AffiliationCategory}.
57-
*
58-
* Defaults to 'external non-academic'.
59-
*/
56+
* An affiliation category @link{AffiliationCategory}.
57+
*
58+
* Defaults to 'external non-academic'.
59+
*/
6060
final AffiliationCategory category
6161

6262
/**
@@ -98,7 +98,7 @@ final class Affiliation {
9898
this.label = AffiliationLabel.MNF
9999
}
100100

101-
Builder id(int id){
101+
Builder id(int id) {
102102
this.id = id
103103
return this
104104
}

src/main/groovy/life/qbic/datamodel/dtos/business/Offer.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import life.qbic.datamodel.dtos.projectmanagement.ProjectIdentifier
1010
*
1111
* @since: 1.12.0
1212
*/
13-
@EqualsAndHashCode
13+
@EqualsAndHashCode(excludes = ["id"])
1414
class Offer {
1515

1616

@@ -247,12 +247,12 @@ class Offer {
247247
}
248248

249249
Builder itemsWithOverhead(List<ProductItem> itemsWithOverhead) {
250-
this.itemsWithOverhead= itemsWithOverhead
250+
this.itemsWithOverhead = itemsWithOverhead
251251
return this
252252
}
253253

254254
Builder itemsWithoutOverhead(List<ProductItem> itemsWithoutOverhead) {
255-
this.itemsWithoutOverhead= itemsWithoutOverhead
255+
this.itemsWithoutOverhead = itemsWithoutOverhead
256256
return this
257257
}
258258

@@ -266,7 +266,7 @@ class Offer {
266266
return this
267267
}
268268

269-
Builder overheadRatio(double overheadRatio){
269+
Builder overheadRatio(double overheadRatio) {
270270
this.overheadRatio = overheadRatio
271271
return this
272272
}
@@ -276,12 +276,12 @@ class Offer {
276276
return this
277277
}
278278

279-
Builder experimentalDesign(String experimentalDesign){
279+
Builder experimentalDesign(String experimentalDesign) {
280280
this.experimentalDesign = Optional.of(experimentalDesign)
281281
return this
282282
}
283283

284-
Builder totalDiscountPrice(double totalDiscountPrice){
284+
Builder totalDiscountPrice(double totalDiscountPrice) {
285285
this.totalDiscountPrice = totalDiscountPrice
286286
return this
287287
}

src/main/groovy/life/qbic/datamodel/dtos/business/ProductItem.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import life.qbic.datamodel.dtos.business.services.Product
1010
* The unit price is always provided in euros.
1111
* @since: 1.9.0
1212
*/
13-
@EqualsAndHashCode
13+
@EqualsAndHashCode(excludes = ["id"])
1414
class ProductItem {
1515

1616
/**

src/main/groovy/life/qbic/datamodel/dtos/business/services/Product.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import life.qbic.datamodel.dtos.business.facilities.Facility
1212
*
1313
* @since 1.12.0
1414
*/
15-
@EqualsAndHashCode
15+
@EqualsAndHashCode(excludes = ["id"])
1616
abstract class Product {
1717

1818
/**

src/main/groovy/life/qbic/datamodel/dtos/general/Person.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import life.qbic.datamodel.dtos.business.Affiliation
1010
* @author Sven Fillinger
1111
* @since 1.11.0
1212
*/
13-
@EqualsAndHashCode
13+
@EqualsAndHashCode(excludes = ["id"])
1414
abstract class Person {
1515

1616
/**

src/main/groovy/life/qbic/datamodel/dtos/projectmanagement/Project.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import life.qbic.datamodel.dtos.business.OfferId
1111
*
1212
* @since 2.3.0
1313
*/
14-
@EqualsAndHashCode
14+
@EqualsAndHashCode(excludes = ["id"])
1515
class Project {
1616

1717
/**

0 commit comments

Comments
 (0)