Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readability refactor #688

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
*/
public class ArchaiusType implements ParameterizedType {

/** Return a ParametrizedType to represent a {@code List<listValuesType>} */
/** Return a parameterizedType to represent a {@code List<listValuesType>} */
public static ParameterizedType forListOf(Class<?> listValuesType) {
Class<?> maybeWrappedType = PRIMITIVE_WRAPPERS.getOrDefault(listValuesType, listValuesType);
return new ArchaiusType(List.class, new Class<?>[] { maybeWrappedType });
}

/** Return a ParametrizedType to represent a {@code Set<setValuesType>} */
/** Return a parameterizedType to represent a {@code Set<setValuesType>} */
public static ParameterizedType forSetOf(Class<?> setValuesType) {
Class<?> maybeWrappedType = PRIMITIVE_WRAPPERS.getOrDefault(setValuesType, setValuesType);
return new ArchaiusType(Set.class, new Class<?>[] { maybeWrappedType });
}

/** Return a ParametrizedType to represent a {@code Map<mapKeysType, mapValuesType>} */
/** Return a parameterizedType to represent a {@code Map<mapKeysType, mapValuesType>} */
public static ParameterizedType forMapOf(Class<?> mapKeysTpe, Class<?> mapValuesType) {
Class<?> maybeWrappedKeyType = PRIMITIVE_WRAPPERS.getOrDefault(mapKeysTpe, mapKeysTpe);
Class<?> maybeWrappedValuesType = PRIMITIVE_WRAPPERS.getOrDefault(mapValuesType, mapValuesType);
Expand Down Expand Up @@ -68,7 +68,7 @@ private ArchaiusType(Class<?> rawType, Class<?>[] typeArguments) {
if (rawType.isArray()
|| rawType.isPrimitive()
|| rawType.getTypeParameters().length != typeArguments.length) {
throw new IllegalArgumentException("The provided rawType and arguments don't look like a supported parametrized type");
throw new IllegalArgumentException("The provided rawType and arguments don't look like a supported parameterized type");
}
}

Expand All @@ -90,6 +90,6 @@ public Type getOwnerType() {
@Override
public String toString() {
String typeArgumentNames = Arrays.stream(typeArguments).map(Class::getSimpleName).collect(Collectors.joining(","));
return String.format("ParametrizedType for %s<%s>", rawType.getSimpleName(), typeArgumentNames);
return String.format("parameterizedType for %s<%s>", rawType.getSimpleName(), typeArgumentNames);
}
}
Loading