/**
  * Creates a new inlined instrumented type.
  *
  * @param classFileVersion The class file version for the given type.
  * @param levelType The name of the instrumented type.
  * @param interfaces The additional interfaces that this type should implement.
  * @param modifiers The name of the instrumented type.
  * @param namingStrategy The naming strategy to apply for the given type.
  */
 public InlineInstrumentedType(
     ClassFileVersion classFileVersion,
     TypeDescription levelType,
     List<TypeDescription> interfaces,
     int modifiers,
     NamingStrategy namingStrategy) {
   super(
       LoadedTypeInitializer.NoOp.INSTANCE,
       TypeInitializer.None.INSTANCE,
       levelType.getName(),
       levelType.getDeclaredFields(),
       levelType.getDeclaredMethods());
   this.levelType = levelType;
   this.modifiers = modifiers;
   Set<TypeDescription> interfaceTypes = new HashSet<TypeDescription>(levelType.getInterfaces());
   interfaceTypes.addAll(interfaces);
   this.interfaces = new ArrayList<TypeDescription>(interfaceTypes);
   this.name =
       isValidTypeName(
           namingStrategy.name(
               new NamingStrategy.UnnamedType.Default(
                   levelType.getSupertype(), interfaces, modifiers, classFileVersion)));
 }
Exemple #2
0
 @Override
 public int hashCode() {
   return namingStrategy.hashCode();
 }
Exemple #3
0
 @Override
 public boolean equals(Object other) {
   return this == other
       || !(other == null || getClass() != other.getClass())
           && namingStrategy.equals(((Unified) other).namingStrategy);
 }