Browse Source

DATACMNS-1438 - Polishing.

pull/351/head
Oliver Drotbohm 7 years ago
parent
commit
48f468c0b5
No known key found for this signature in database
GPG Key ID: 6E42B5787543F690
  1. 8
      src/main/java/org/springframework/data/mapping/PersistentPropertyPaths.java
  2. 40
      src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java

8
src/main/java/org/springframework/data/mapping/PersistentPropertyPaths.java

@ -22,7 +22,7 @@ import org.springframework.data.util.Streamable; @@ -22,7 +22,7 @@ import org.springframework.data.util.Streamable;
/**
* A wrapper for a collection of {@link PersistentPropertyPath}s.
*
*
* @author Oliver Gierke
* @since 2.1
* @soundtrack Stuart McCallum - North Star (City)
@ -32,14 +32,14 @@ public interface PersistentPropertyPaths<T, P extends PersistentProperty<P>> @@ -32,14 +32,14 @@ public interface PersistentPropertyPaths<T, P extends PersistentProperty<P>>
/**
* Returns the first {@link PersistentPropertyPath}.
*
*
* @return
*/
Optional<PersistentPropertyPath<P>> getFirst();
/**
* Returns whether the given path is contained in the current {@link PersistentPropertyPaths}.
*
*
* @param path must not be {@literal null}.
* @return
*/
@ -47,7 +47,7 @@ public interface PersistentPropertyPaths<T, P extends PersistentProperty<P>> @@ -47,7 +47,7 @@ public interface PersistentPropertyPaths<T, P extends PersistentProperty<P>>
/**
* Returns whether the given {@link PropertyPath} is contained in the current {@link PersistentPropertyPaths}.
*
*
* @param path must not be {@literal null}.
* @return
*/

40
src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java

@ -20,17 +20,7 @@ import lombok.RequiredArgsConstructor; @@ -20,17 +20,7 @@ import lombok.RequiredArgsConstructor;
import lombok.ToString;
import lombok.Value;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@ -54,7 +44,7 @@ import org.springframework.util.StringUtils; @@ -54,7 +44,7 @@ import org.springframework.util.StringUtils;
/**
* A factory implementation to create {@link PersistentPropertyPath} instances in various ways.
*
*
* @author Oliver Gierke
* @since 2.1
* @soundtrack Cypress Hill - Boom Biddy Bye Bye (Fugees Remix, Unreleased & Revamped)
@ -69,7 +59,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -69,7 +59,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} for the given property path on the given type.
*
*
* @param type must not be {@literal null}.
* @param propertyPath must not be {@literal null}.
* @return
@ -84,7 +74,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -84,7 +74,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} for the given property path on the given type.
*
*
* @param type must not be {@literal null}.
* @param propertyPath must not be {@literal null}.
* @return
@ -99,7 +89,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -99,7 +89,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} for the given {@link PropertyPath}.
*
*
* @param path must not be {@literal null}.
* @return
*/
@ -113,7 +103,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -113,7 +103,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} based on a given type and {@link Predicate} to select properties
* matching it.
*
*
* @param type must not be {@literal null}.
* @param propertyFilter must not be {@literal null}.
* @return
@ -129,7 +119,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -129,7 +119,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} based on a given type and {@link Predicate} to select properties
* matching it.
*
*
* @param type must not be {@literal null}.
* @param propertyFilter must not be {@literal null}.
* @param traversalGuard must not be {@literal null}.
@ -148,7 +138,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -148,7 +138,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} based on a given type and {@link Predicate} to select properties
* matching it.
*
*
* @param type must not be {@literal null}.
* @param propertyFilter must not be {@literal null}.
* @return
@ -160,7 +150,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -160,7 +150,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link PersistentPropertyPath} based on a given type and {@link Predicate} to select properties
* matching it.
*
*
* @param type must not be {@literal null}.
* @param propertyFilter must not be {@literal null}.
* @param traversalGuard must not be {@literal null}.
@ -297,7 +287,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -297,7 +287,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Creates a new {@link DefaultPersistentPropertyPaths} instance
*
*
* @param type
* @param paths
* @return
@ -312,7 +302,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -312,7 +302,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
return new DefaultPersistentPropertyPaths<>(type, sorted);
}
/*
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.PersistentPropertyPaths#getFirst()
*/
@ -321,7 +311,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -321,7 +311,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
return isEmpty() ? Optional.empty() : Optional.of(iterator().next());
}
/*
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.PersistentPropertyPaths#contains(java.lang.String)
*/
@ -330,7 +320,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -330,7 +320,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
return contains(PropertyPath.from(path, type));
}
/*
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.PersistentPropertyPaths#contains(org.springframework.data.mapping.PropertyPath)
*/
@ -348,7 +338,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -348,7 +338,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
return stream().anyMatch(it -> dotPath.equals(it.toDotPath()));
}
/*
/*
* (non-Javadoc)
* @see java.lang.Iterable#iterator()
*/
@ -376,7 +366,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends @@ -376,7 +366,7 @@ class PersistentPropertyPathFactory<E extends PersistentEntity<?, P>, P extends
/**
* Simple {@link Comparator} to sort {@link PersistentPropertyPath} instances by their property segment's name
* length.
*
*
* @author Oliver Gierke
* @since 2.1
*/

Loading…
Cancel
Save