Package org.cadixdev.lorenz
Interface MappingSet
-
- All Superinterfaces:
Reversible<MappingSet,MappingSet>
- All Known Implementing Classes:
MappingSetImpl
public interface MappingSet extends Reversible<MappingSet,MappingSet>
The container forTopLevelClassMappings, allowing for their creating and locating anyClassMapping.- Since:
- 0.1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default MappingSetaddFieldTypeProvider(FieldTypeProvider fieldTypeProvider)Adds the givenFieldTypeProviderto this set of mappings.default java.util.Optional<? extends ClassMapping<?,?>>computeClassMapping(java.lang.String obfuscatedName)Attempts to locate a class mapping for the given obfuscated name.default MappingSetcopy()Produces a new mapping set, which is a clone copy of the original.static MappingSetcreate()Creates a mapping set, using the default Lorenz model implementation.static MappingSetcreate(MappingSetModelFactory modelFactory)Creates a mapping set, using the given model factory.TopLevelClassMappingcreateTopLevelClassMapping(java.lang.String obfuscatedName, java.lang.String deobfuscatedName)Creates a top-level class mapping with the given obfuscated and de-obfuscated names.default org.cadixdev.bombe.type.FieldTypedeobfuscate(org.cadixdev.bombe.type.FieldType type)Gets the de-obfuscated view of the given field type.default org.cadixdev.bombe.type.MethodDescriptordeobfuscate(org.cadixdev.bombe.type.MethodDescriptor descriptor)Gets the de-obfuscated descriptor of the method.default org.cadixdev.bombe.type.Typedeobfuscate(org.cadixdev.bombe.type.Type type)Gets the de-obfuscated view of the given type.default java.util.Optional<? extends ClassMapping<?,?>>getClassMapping(java.lang.String obfuscatedName)Gets the class mapping of the given obfuscated name.CascadingFieldTypeProvidergetFieldTypeProvider()Gets the field type provider in use for this set of mappings.MappingSetModelFactorygetModelFactory()Gets the underlying model factory, that is used to construct the implementation classes for all the models.default ClassMapping<?,?>getOrCreateClassMapping(java.lang.String obfuscatedName)Gets, or creates should it not exist, a class mapping, of the given obfuscated name.default TopLevelClassMappinggetOrCreateTopLevelClassMapping(java.lang.String obfuscatedName)Gets, or creates should it not exist, a top-level class mapping of the given obfuscated name.java.util.Optional<TopLevelClassMapping>getTopLevelClassMapping(java.lang.String obfuscatedName)Gets the top-level class mapping of the given obfuscated name of the class mapping, should it exist.java.util.Collection<TopLevelClassMapping>getTopLevelClassMappings()Gets an immutable collection of all of the top-level class mappings of the mapping set.booleanhasTopLevelClassMapping(java.lang.String obfuscatedName)Establishes whether the mapping set contains a top-level class mapping of the given obfuscated name.default MappingSetmerge(MappingSet with)Produces a new mapping set, that is a merged copy with the provided mappings.default MappingSetmerge(MappingSet with, MappingSet parent)Produces a new mapping set, that is a merged copy with the provided mappings.default MappingSetremoveFieldTypeProvider(FieldTypeProvider fieldTypeProvider)Removes the givenFieldTypeProviderto this set of mappings.default MappingSetreverse()Produces a new mapping set that is a reverse copy of the original.default MappingSetreverse(MappingSet parent)Produces a new object that is a reverse copy of the original.
-
-
-
Method Detail
-
create
static MappingSet create()
Creates a mapping set, using the default Lorenz model implementation.- Returns:
- The mapping set
- Since:
- 0.2.0
-
create
static MappingSet create(MappingSetModelFactory modelFactory)
Creates a mapping set, using the given model factory.- Parameters:
modelFactory- The model factory to use- Returns:
- The mapping set
- Since:
- 0.3.0
-
getModelFactory
MappingSetModelFactory getModelFactory()
Gets the underlying model factory, that is used to construct the implementation classes for all the models.- Returns:
- The model factory
-
getTopLevelClassMappings
java.util.Collection<TopLevelClassMapping> getTopLevelClassMappings()
Gets an immutable collection of all of the top-level class mappings of the mapping set.- Returns:
- The top-level class mappings
-
createTopLevelClassMapping
TopLevelClassMapping createTopLevelClassMapping(java.lang.String obfuscatedName, java.lang.String deobfuscatedName)
Creates a top-level class mapping with the given obfuscated and de-obfuscated names.- Parameters:
obfuscatedName- The obfuscated name of the top-level classdeobfuscatedName- The de-obfuscated name of the top-level class- Returns:
- The top-level class mapping, to allow for chaining
-
getTopLevelClassMapping
java.util.Optional<TopLevelClassMapping> getTopLevelClassMapping(java.lang.String obfuscatedName)
Gets the top-level class mapping of the given obfuscated name of the class mapping, should it exist.- Parameters:
obfuscatedName- The obfuscated name of the top-level class mapping- Returns:
- The top-level class mapping, wrapped in an
Optional
-
getOrCreateTopLevelClassMapping
default TopLevelClassMapping getOrCreateTopLevelClassMapping(java.lang.String obfuscatedName)
Gets, or creates should it not exist, a top-level class mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the top-level class mapping- Returns:
- The top-level class mapping
-
hasTopLevelClassMapping
boolean hasTopLevelClassMapping(java.lang.String obfuscatedName)
Establishes whether the mapping set contains a top-level class mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the top-level class mapping- Returns:
trueshould a top-level class mapping of the given obfuscated name exist in the mapping set;falseotherwise
-
getClassMapping
default java.util.Optional<? extends ClassMapping<?,?>> getClassMapping(java.lang.String obfuscatedName)
Gets the class mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name- Returns:
- The class mapping, wrapped in an
Optional
-
computeClassMapping
default java.util.Optional<? extends ClassMapping<?,?>> computeClassMapping(java.lang.String obfuscatedName)
Attempts to locate a class mapping for the given obfuscated name.This is equivalent to calling
getClassMapping(String), except that it will insert a new inner class mapping in case a class mapping for the outer class exists.This method exists to simplify remapping, where it is important to keep inner classes a part of the outer class.
- Parameters:
obfuscatedName- The obfuscated name- Returns:
- The class mapping, wrapped in an
Optional
-
getOrCreateClassMapping
default ClassMapping<?,?> getOrCreateClassMapping(java.lang.String obfuscatedName)
Gets, or creates should it not exist, a class mapping, of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the class mapping- Returns:
- The class mapping
-
getFieldTypeProvider
CascadingFieldTypeProvider getFieldTypeProvider()
Gets the field type provider in use for this set of mappings.- Returns:
- The field type provider
- Since:
- 0.4.0
-
addFieldTypeProvider
default MappingSet addFieldTypeProvider(FieldTypeProvider fieldTypeProvider)
Adds the givenFieldTypeProviderto this set of mappings.- Parameters:
fieldTypeProvider- The field type provider- Returns:
this, for chaining- Since:
- 0.4.0
- See Also:
CascadingFieldTypeProvider.add(FieldTypeProvider)
-
removeFieldTypeProvider
default MappingSet removeFieldTypeProvider(FieldTypeProvider fieldTypeProvider)
Removes the givenFieldTypeProviderto this set of mappings.- Parameters:
fieldTypeProvider- The field type provider- Returns:
this, for chaining- Since:
- 0.4.0
- See Also:
CascadingFieldTypeProvider.remove(FieldTypeProvider)
-
deobfuscate
default org.cadixdev.bombe.type.Type deobfuscate(org.cadixdev.bombe.type.Type type)
Gets the de-obfuscated view of the given type.- Parameters:
type- The type to de-obfuscate- Returns:
- The de-obfuscated type
- Since:
- 0.5.0
-
deobfuscate
default org.cadixdev.bombe.type.FieldType deobfuscate(org.cadixdev.bombe.type.FieldType type)
Gets the de-obfuscated view of the given field type.- Parameters:
type- The type to de-obfuscate- Returns:
- The de-obfuscated type
- Since:
- 0.5.0
-
deobfuscate
default org.cadixdev.bombe.type.MethodDescriptor deobfuscate(org.cadixdev.bombe.type.MethodDescriptor descriptor)
Gets the de-obfuscated descriptor of the method.- Parameters:
descriptor- The descriptor to de-obfuscate- Returns:
- The de-obfuscated descriptor
- Since:
- 0.5.0
-
reverse
default MappingSet reverse()
Produces a new mapping set that is a reverse copy of the original.- Returns:
- The reversed set
- Since:
- 0.5.0
-
reverse
default MappingSet reverse(MappingSet parent)
Description copied from interface:ReversibleProduces a new object that is a reverse copy of the original.- Specified by:
reversein interfaceReversible<MappingSet,MappingSet>- Parameters:
parent- The parent object- Returns:
- The reversed object
-
merge
default MappingSet merge(MappingSet with)
Produces a new mapping set, that is a merged copy with the provided mappings.- Parameters:
with- The set to merge with- Returns:
- The merged set
- Since:
- 0.5.0
-
merge
default MappingSet merge(MappingSet with, MappingSet parent)
Produces a new mapping set, that is a merged copy with the provided mappings.- Parameters:
with- The set to merge withparent- The set to create entries- Returns:
- The merged set
- Since:
- 0.5.0
-
copy
default MappingSet copy()
Produces a new mapping set, which is a clone copy of the original.- Returns:
- The cloned set
- Since:
- 0.5.0
-
-