Package org.cadixdev.lorenz.model
Interface Mapping<M extends Mapping,P>
-
- Type Parameters:
M- The type of the mapping, used for chainingP- The type of the parent object
- All Superinterfaces:
Reversible<M,P>
- All Known Subinterfaces:
ClassMapping<M,P>,FieldMapping,InnerClassMapping,MemberMapping<M,P>,MethodMapping,MethodParameterMapping,TopLevelClassMapping
- All Known Implementing Classes:
AbstractClassMappingImpl,AbstractMappingImpl,AbstractMemberMappingImpl,FieldMappingImpl,InnerClassMappingImpl,MethodMappingImpl,MethodParameterMappingImpl,TopLevelClassMappingImpl
public interface Mapping<M extends Mapping,P> extends Reversible<M,P>
Represents a de-obfuscation mapping for mappable constructs of the Java class format - e.g. classes, fields, and methods.- Since:
- 0.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Mcopy(P parent)Clones this mapping, to a given parent.<T> java.util.Optional<T>get(ExtensionKey<T> key)Gets the value of the extension data, if it exists.java.lang.StringgetDeobfuscatedName()Gets the de-obfuscated name of the member being represented.java.lang.StringgetFullDeobfuscatedName()Gets the fully-qualified de-obfuscated name of the member.java.lang.StringgetFullObfuscatedName()Gets the fully-qualified obfuscated name of the member.MappingSetgetMappings()Gets theMappingSetthat the mappings belongs to.java.lang.StringgetObfuscatedName()Gets the obfuscated name of the member being represented.default <T> TgetOrCreate(ExtensionKey<T> key, java.util.function.Supplier<T> supplier)Gets the value of the extension data, or uses the supplier (setting that value too).default java.lang.StringgetSimpleDeobfuscatedName()Gets the unqualified ("simple") de-obfuscated name of the member.default java.lang.StringgetSimpleObfuscatedName()Gets the unqualified ("simple") obfuscated name of the member.booleanhasDeobfuscatedName()Establishes whether the mapping has had a de-obfuscated name set.Mmerge(M with, P parent)Merges this mapping with another, to a given parent.<T> voidset(ExtensionKey<T> key, T value)Sets the given extension data to the given value.MsetDeobfuscatedName(java.lang.String deobfuscatedName)Sets the de-obfuscated name of the member.-
Methods inherited from interface org.cadixdev.lorenz.util.Reversible
reverse
-
-
-
-
Method Detail
-
getObfuscatedName
java.lang.String getObfuscatedName()
Gets the obfuscated name of the member being represented.- Returns:
- The obfuscated name
-
getDeobfuscatedName
java.lang.String getDeobfuscatedName()
Gets the de-obfuscated name of the member being represented. This can be altered through use ofsetDeobfuscatedName(String).- Returns:
- The de-obfuscated name
-
setDeobfuscatedName
M setDeobfuscatedName(java.lang.String deobfuscatedName)
Sets the de-obfuscated name of the member.- Parameters:
deobfuscatedName- The new de-obfuscated name- Returns:
thisfor chaining
-
getSimpleObfuscatedName
default java.lang.String getSimpleObfuscatedName()
Gets the unqualified ("simple") obfuscated name of the member.- Returns:
- The simple obfuscated name
- Since:
- 0.4.0
-
getSimpleDeobfuscatedName
default java.lang.String getSimpleDeobfuscatedName()
Gets the unqualified ("simple") de-obfuscated name of the member.- Returns:
- The simple de-obfuscated name
- Since:
- 0.4.0
-
getFullObfuscatedName
java.lang.String getFullObfuscatedName()
Gets the fully-qualified obfuscated name of the member.- Returns:
- The fully-qualified obfuscated name
-
getFullDeobfuscatedName
java.lang.String getFullDeobfuscatedName()
Gets the fully-qualified de-obfuscated name of the member.- Returns:
- The fully-qualified de-obfuscated name
-
hasDeobfuscatedName
boolean hasDeobfuscatedName()
Establishes whether the mapping has had a de-obfuscated name set.- Returns:
Trueif the mapping is mapped,falseotherwise
-
getMappings
MappingSet getMappings()
Gets theMappingSetthat the mappings belongs to.- Returns:
- The owning mapping set
-
merge
M merge(M with, P parent)
Merges this mapping with another, to a given parent.- Parameters:
with- The mapping to merge withparent- The parent- Returns:
- The new mapping
- Since:
- 0.5.0
-
copy
M copy(P parent)
Clones this mapping, to a given parent.- Parameters:
parent- The parent- Returns:
- The cloned mapping
- Since:
- 0.5.0
-
get
<T> java.util.Optional<T> get(ExtensionKey<T> key)
Gets the value of the extension data, if it exists.- Type Parameters:
T- The type of the extension data- Parameters:
key- The key of the extension data- Returns:
- The value, wrapped in an
Optional - Since:
- 0.5.0
-
getOrCreate
default <T> T getOrCreate(ExtensionKey<T> key, java.util.function.Supplier<T> supplier)
Gets the value of the extension data, or uses the supplier (setting that value too).- Type Parameters:
T- The type of the extension data- Parameters:
key- The key of the extension datasupplier- The "backup" value supplier- Returns:
- The value
- Since:
- 0.5.0
-
set
<T> void set(ExtensionKey<T> key, T value)
Sets the given extension data to the given value.- Type Parameters:
T- The type of the extension data- Parameters:
key- The extension data keyvalue- The extension data value- Since:
- 0.5.0
-
-