DATACMNS-1726 - Delombok source files.

This commit is contained in:
Mark Paluch
2020-05-14 15:46:03 +02:00
parent 302fa6335f
commit 4be5aae181
99 changed files with 3052 additions and 715 deletions

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.data.querydsl;
import lombok.experimental.UtilityClass;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;
@@ -29,12 +27,13 @@ import com.querydsl.core.types.PathType;
*
* @author Oliver Gierke
*/
@UtilityClass
public class QuerydslUtils {
public abstract class QuerydslUtils {
public static final boolean QUERY_DSL_PRESENT = org.springframework.util.ClassUtils
.isPresent("com.querydsl.core.types.Predicate", QuerydslUtils.class.getClassLoader());
private QuerydslUtils() {}
/**
* Returns the property path for the given {@link Path}.
*

View File

@@ -15,11 +15,6 @@
*/
package org.springframework.data.querydsl.binding;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.Optional;
@@ -29,6 +24,7 @@ import org.springframework.data.mapping.PropertyPath;
import org.springframework.data.querydsl.EntityPathResolver;
import org.springframework.data.util.TypeInformation;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import com.querydsl.core.types.Path;
@@ -41,13 +37,14 @@ import com.querydsl.core.types.dsl.CollectionPathBase;
* @author Christoph Strobl
* @since 1.13
*/
@ToString
@EqualsAndHashCode
@RequiredArgsConstructor(staticName = "of", access = AccessLevel.PRIVATE)
class PropertyPathInformation implements PathInformation {
private final PropertyPath path;
private PropertyPathInformation(PropertyPath path) {
this.path = path;
}
/**
* Creates a new {@link PropertyPathInformation} for the given path and type.
*
@@ -70,6 +67,10 @@ class PropertyPathInformation implements PathInformation {
return PropertyPathInformation.of(PropertyPath.from(path, type));
}
private static PropertyPathInformation of(PropertyPath path) {
return new PropertyPathInformation(path);
}
/*
* (non-Javadoc)
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafType()
@@ -149,4 +150,41 @@ class PropertyPathInformation implements PathInformation {
return (Path<?>) value;
});
}
/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PropertyPathInformation)) {
return false;
}
PropertyPathInformation that = (PropertyPathInformation) o;
return ObjectUtils.nullSafeEquals(path, that.path);
}
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(path);
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "PropertyPathInformation(path=" + this.path + ")";
}
}

View File

@@ -15,10 +15,6 @@
*/
package org.springframework.data.querydsl.binding;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashMap;
@@ -34,6 +30,7 @@ import org.springframework.data.util.Optionals;
import org.springframework.data.util.TypeInformation;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import com.querydsl.core.types.Path;
@@ -469,10 +466,13 @@ public class QuerydslBindings {
*
* @author Oliver Gierke
*/
@RequiredArgsConstructor
public final class TypeBinder<T> {
private final @NonNull Class<T> type;
private final Class<T> type;
public TypeBinder(Class<T> type) {
this.type = type;
}
/**
* Configures the given {@link SingleValueBinding} to be used for the current type.
@@ -511,11 +511,15 @@ public class QuerydslBindings {
* @author Oliver Gierke
* @since 1.11
*/
@Value
private static class PathAndBinding<P extends Path<? extends T>, T> {
private static final class PathAndBinding<P extends Path<? extends T>, T> {
@NonNull Optional<Path<?>> path;
@NonNull Optional<MultiValueBinding<P, T>> binding;
private final Optional<Path<?>> path;
private final Optional<MultiValueBinding<P, T>> binding;
PathAndBinding(Optional<Path<?>> path, Optional<MultiValueBinding<P, T>> binding) {
this.path = path;
this.binding = binding;
}
public static <T, P extends Path<? extends T>> PathAndBinding<P, T> withPath(P path) {
return new PathAndBinding<>(Optional.of(path), Optional.empty());
@@ -528,5 +532,52 @@ public class QuerydslBindings {
public PathAndBinding<P, T> with(MultiValueBinding<P, T> binding) {
return new PathAndBinding<>(path, Optional.of(binding));
}
public Optional<Path<?>> getPath() {
return this.path;
}
public Optional<MultiValueBinding<P, T>> getBinding() {
return this.binding;
}
/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PathAndBinding)) {
return false;
}
PathAndBinding<?, ?> that = (PathAndBinding<?, ?>) o;
if (!ObjectUtils.nullSafeEquals(path, that.path)) {
return false;
}
return ObjectUtils.nullSafeEquals(binding, that.binding);
}
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
int result = ObjectUtils.nullSafeHashCode(path);
result = 31 * result + ObjectUtils.nullSafeHashCode(binding);
return result;
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "QuerydslBindings.PathAndBinding(path=" + this.getPath() + ", binding=" + this.getBinding() + ")";
}
}
}

View File

@@ -15,16 +15,13 @@
*/
package org.springframework.data.querydsl.binding;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import java.beans.PropertyDescriptor;
import org.springframework.beans.BeanUtils;
import org.springframework.data.querydsl.EntityPathResolver;
import org.springframework.data.querydsl.QuerydslUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
import com.querydsl.core.types.Path;
@@ -34,13 +31,18 @@ import com.querydsl.core.types.Path;
* @author Oliver Gierke
* @since 1.13
*/
@ToString
@EqualsAndHashCode
@RequiredArgsConstructor(staticName = "of")
class QuerydslPathInformation implements PathInformation {
private final Path<?> path;
private QuerydslPathInformation(Path<?> path) {
this.path = path;
}
public static QuerydslPathInformation of(Path<?> path) {
return new QuerydslPathInformation(path);
}
/*
* (non-Javadoc)
* @see org.springframework.data.querydsl.binding.MappedPath#getLeafType()
@@ -101,4 +103,41 @@ class QuerydslPathInformation implements PathInformation {
public Path<?> reifyPath(EntityPathResolver resolver) {
return path;
}
/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof QuerydslPathInformation)) {
return false;
}
QuerydslPathInformation that = (QuerydslPathInformation) o;
return ObjectUtils.nullSafeEquals(path, that.path);
}
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(path);
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "QuerydslPathInformation(path=" + this.path + ")";
}
}