Skip to content

Commit 41fe897

Browse files
committed
DATACMNS-809 - Polishing.
Made as many methods in ClassGeneratingPropertyAccessorFactory static as possible. Some code formatting. Some warning suppressions where needed. Original pull request: #159.
1 parent 899a98c commit 41fe897

8 files changed

+167
-147
lines changed

src/main/java/org/springframework/data/mapping/model/BasicPersistentEntity.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
package org.springframework.data.mapping.model;
1717

18+
import lombok.NonNull;
19+
import lombok.RequiredArgsConstructor;
20+
1821
import java.io.Serializable;
1922
import java.lang.annotation.Annotation;
2023
import java.util.ArrayList;
@@ -63,12 +66,11 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
6366

6467
private final Map<String, P> propertyCache;
6568
private final Map<Class<? extends Annotation>, Annotation> annotationCache;
69+
private final PersistentPropertyAccessorFactory propertyAccessorFactory;
6670

6771
private P idProperty;
6872
private P versionProperty;
6973

70-
private final PersistentPropertyAccessorFactory propertyAccessorFactory;
71-
7274
/**
7375
* Creates a new {@link BasicPersistentEntity} from the given {@link TypeInformation}.
7476
*
@@ -440,17 +442,17 @@ public Object getIdentifier() {
440442
*
441443
* @author Oliver Gierke
442444
*/
445+
@RequiredArgsConstructor
443446
private static final class AssociationComparator<P extends PersistentProperty<P>>
444447
implements Comparator<Association<P>>, Serializable {
445448

446449
private static final long serialVersionUID = 4508054194886854513L;
447-
private final Comparator<P> delegate;
448-
449-
public AssociationComparator(Comparator<P> delegate) {
450-
Assert.notNull(delegate);
451-
this.delegate = delegate;
452-
}
450+
private final @NonNull Comparator<P> delegate;
453451

452+
/*
453+
* (non-Javadoc)
454+
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
455+
*/
454456
public int compare(Association<P> left, Association<P> right) {
455457
return delegate.compare(left.getInverse(), right.getInverse());
456458
}

0 commit comments

Comments
 (0)