// Generated by delombok at Sun Feb 26 12:31:38 KST 2017
package scouter.bytebuddy.matcher;
import scouter.bytebuddy.description.type.TypeDefinition;
import scouter.bytebuddy.description.type.TypeDescription;
import java.util.ArrayList;
import java.util.List;
/**
* An element matcher that matches a collection of types by their erasures.
*
* @param <T> The type of the matched entity.
*/
public class CollectionErasureMatcher<T extends Iterable<? extends TypeDefinition>> extends ElementMatcher.Junction.AbstractBase<T> {
/**
* The matcher to be applied to the raw types.
*/
private final ElementMatcher<? super Iterable<? extends TypeDescription>> matcher;
/**
* Creates a new raw type matcher.
*
* @param matcher The matcher to be applied to the raw types.
*/
public CollectionErasureMatcher(ElementMatcher<? super Iterable<? extends TypeDescription>> matcher) {
this.matcher = matcher;
}
@Override
public boolean matches(T target) {
List<TypeDescription> typeDescriptions = new ArrayList<TypeDescription>();
for (TypeDefinition typeDefinition : target) {
typeDescriptions.add(typeDefinition.asErasure());
}
return matcher.matches(typeDescriptions);
}
@Override
public String toString() {
return "erasures(" + matcher + ')';
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof CollectionErasureMatcher)) return false;
final CollectionErasureMatcher<?> other = (CollectionErasureMatcher<?>) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$matcher = this.matcher;
final java.lang.Object other$matcher = other.matcher;
if (this$matcher == null ? other$matcher != null : !this$matcher.equals(other$matcher)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
protected boolean canEqual(final java.lang.Object other) {
return other instanceof CollectionErasureMatcher;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $matcher = this.matcher;
result = result * PRIME + ($matcher == null ? 43 : $matcher.hashCode());
return result;
}
}