Skip to content

Commit

Permalink
DATACMNS-1126 - Polishing.
Browse files Browse the repository at this point in the history
Trailing whitespace in ReflectionUtils.

Original pull request: #233.
  • Loading branch information
mp911de authored and odrotbohm committed Aug 25, 2017
1 parent 22b3780 commit b05c4e7
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/main/java/org/springframework/data/util/ReflectionUtils.java
Expand Up @@ -40,7 +40,7 @@

/**
* Spring Data specific reflection utility methods and classes.
*
*
* @author Oliver Gierke
* @author Thomas Darimont
* @author Christoph Strobl
Expand All @@ -56,7 +56,7 @@ public class ReflectionUtils {
/**
* Creates an instance of the class with the given fully qualified name or returns the given default instance if the
* class cannot be loaded or instantiated.
*
*
* @param classname the fully qualified class name to create an instance for.
* @param defaultInstance the instance to fall back to in case the given class cannot be loaded or instantiated.
* @return
Expand All @@ -74,39 +74,39 @@ public static <T> T createInstanceIfPresent(String classname, T defaultInstance)

/**
* A {@link FieldFilter} that has a description.
*
*
* @author Oliver Gierke
*/
public interface DescribedFieldFilter extends FieldFilter {

/**
* Returns the description of the field filter. Used in exceptions being thrown in case uniqueness shall be enforced
* on the field filter.
*
*
* @return
*/
String getDescription();
}

/**
* A {@link FieldFilter} for a given annotation.
*
*
* @author Oliver Gierke
*/
@RequiredArgsConstructor
public static class AnnotationFieldFilter implements DescribedFieldFilter {

private final @NonNull Class<? extends Annotation> annotationType;

/*
/*
* (non-Javadoc)
* @see org.springframework.util.ReflectionUtils.FieldFilter#matches(java.lang.reflect.Field)
*/
public boolean matches(Field field) {
return AnnotationUtils.getAnnotation(field, annotationType) != null;
}

/*
/*
* (non-Javadoc)
* @see org.springframework.data.util.ReflectionUtils.DescribedFieldFilter#getDescription()
*/
Expand All @@ -117,7 +117,7 @@ public String getDescription() {

/**
* Finds the first field on the given class matching the given {@link FieldFilter}.
*
*
* @param type must not be {@literal null}.
* @param filter must not be {@literal null}.
* @return the field matching the filter or {@literal null} in case no field could be found.
Expand All @@ -140,7 +140,7 @@ public String getDescription() {
/**
* Finds the field matching the given {@link DescribedFieldFilter}. Will make sure there's only one field matching the
* filter.
*
*
* @see #findField(Class, DescribedFieldFilter, boolean)
* @param type must not be {@literal null}.
* @param filter must not be {@literal null}.
Expand All @@ -155,7 +155,7 @@ public static Field findField(Class<?> type, DescribedFieldFilter filter) {
/**
* Finds the field matching the given {@link DescribedFieldFilter}. Will make sure there's only one field matching the
* filter in case {@code enforceUniqueness} is {@literal true}.
*
*
* @param type must not be {@literal null}.
* @param filter must not be {@literal null}.
* @param enforceUniqueness whether to enforce uniqueness of the field
Expand Down Expand Up @@ -198,7 +198,7 @@ public static Field findField(Class<?> type, DescribedFieldFilter filter, boolea

/**
* Finds the field of the given name on the given type.
*
*
* @param type must not be {@literal null}.
* @param name must not be {@literal null} or empty.
* @return
Expand All @@ -217,7 +217,7 @@ public static Field findRequiredField(Class<?> type, String name) {

/**
* Sets the given field on the given object to the given value. Will make sure the given field is accessible.
*
*
* @param field must not be {@literal null}.
* @param target must not be {@literal null}.
* @param value
Expand All @@ -230,7 +230,7 @@ public static void setField(Field field, Object target, @Nullable Object value)

/**
* Finds a constructor on the given type that matches the given constructor arguments.
*
*
* @param type must not be {@literal null}.
* @param constructorArguments must not be {@literal null}.
* @return a {@link Constructor} that is compatible with the given arguments.
Expand All @@ -247,7 +247,7 @@ public static Optional<Constructor<?>> findConstructor(Class<?> type, Object...

/**
* Returns the method with the given name of the given class and parameter types.
*
*
* @param type must not be {@literal null}.
* @param name must not be {@literal null}.
* @param parameterTypes must not be {@literal null}.
Expand All @@ -273,7 +273,7 @@ public static Method findRequiredMethod(Class<?> type, String name, Class<?>...

/**
* Returns a {@link Stream} of the return and parameters types of the given {@link Method}.
*
*
* @param method must not be {@literal null}.
* @return
* @since 2.0
Expand All @@ -290,7 +290,7 @@ public static Stream<Class<?>> returnTypeAndParameters(Method method) {

/**
* Returns the {@link Method} with the given name and parameters declared on the given type, if available.
*
*
* @param type must not be {@literal null}.
* @param name must not be {@literal null} or empty.
* @param parameterTypes must not be {@literal null}.
Expand Down

0 comments on commit b05c4e7

Please sign in to comment.