public Map<String,MappedClass> remapClass(MappedClass mc,Map<String,MappedClass> mappings,MappingMode mode){
  if (mc.isLibrary() || remapped.contains(mc.getOriginalName())) {
    return mappings;
  }
  if (mc.hasParent()) {
    mappings=remapClass(mc.getParent(),mappings,mode);
  }
  for (  MappedClass interfaze : mc.getInterfaces()) {
    mappings=remapClass(interfaze,mappings,mode);
  }
  if (mc.isInnerClass()) {
    mappings=remapClass(mc.getOuterClass(),mappings,mode);
  }
  if (!mc.isInnerClass()) {
    mc.setNewName(mode.getClassName(mc));
  }
 else {
    MappedClass outter=mc.getOuterClass();
    String newName=mode.getClassName(mc);
    String post=newName.contains("/") ? newName.substring(newName.lastIndexOf("/") + 1,newName.length()) : newName;
    mc.setNewName(outter.getNewName() + "$" + post);
  }
  for (  MappedMember mm : mc.getFields()) {
    mm.setNewName(mode.getFieldName(mm));
  }
  for (  MappedMember mm : mc.getMethods()) {
    if (keepName(mm) || mm.isLibrary()) {
      continue;
    }
    MappedMember override=ParentUtils.findMethodOverride(mm);
    if (override.equals(mm)) {
      mm.setNewName(mode.getMethodName(mm));
    }
 else {
      mm.setNewName(override.getNewName());
      if (mm.doesOverride() && !mm.isOverriden()) {
        fixOverrideNames(mm,override);
      }
    }
    MethodNode mn=mm.getMethodNode();
    updateStrings(mn,mappings);
  }
  remapped.add(mc.getOriginalName());
  return mappings;
}

public Map < String , MappedClass > remapClass ( MappedClass mc , Map < String , MappedClass > mappings , MappingMode mode ) { if ( mc . isLibrary ( ) || remapped . contains ( mc . getOriginalName ( ) ) ) { return mappings ; } if ( mc . hasParent ( ) ) { mappings = remapClass ( mc . getParent ( ) , mappings , mode ) ; } for ( MappedClass interfaze : mc . getInterfaces ( ) ) { mappings = remapClass ( interfaze , mappings , mode ) ; } if ( mc . isInnerClass ( ) ) { mappings = remapClass ( mc . getOuterClass ( ) , mappings , mode ) ; } if ( ! mc . isInnerClass ( ) ) { mc . setNewName ( mode . getClassName ( mc ) ) ; } else { MappedClass outter = mc . getOuterClass ( ) ; String newName = mode . getClassName ( mc ) ; String post = newName . contains ( "/" ) ? newName . substring ( newName . lastIndexOf ( "/" ) + 1 , newName . length ( ) ) : newName ; mc . setNewName ( outter . getNewName ( ) + "$" + post ) ; } for ( MappedMember mm : mc . getFields ( ) ) { mm . setNewName ( mode . getFieldName ( mm ) ) ; } for ( MappedMember mm : mc . getMethods ( ) ) { if ( keepName ( mm ) || mm . isLibrary ( ) ) { continue ; } MappedMember override = ParentUtils . findMethodOverride ( mm ) ; if ( override . equals ( mm ) ) { mm . setNewName ( mode . getMethodName ( mm ) ) ; } else { mm . setNewName ( override . getNewName ( ) ) ; if ( mm . doesOverride ( ) && ! mm . isOverriden ( ) ) { fixOverrideNames ( mm , override ) ; } } MethodNode mn = mm . getMethodNode ( ) ; updateStrings ( mn , mappings ) ; } remapped . add ( mc . getOriginalName ( ) ) ; return mappings ; }
gives a mappedclass based on rules defined in a given mappingmode
