Package org.cadixdev.lorenz.impl.model
Class AbstractMappingImpl<M extends Mapping,P>
- java.lang.Object
-
- org.cadixdev.lorenz.impl.model.AbstractMappingImpl<M,P>
-
- Type Parameters:
M- The type of the mappingP- The type of the parent
- All Implemented Interfaces:
Mapping<M,P>,Reversible<M,P>
- Direct Known Subclasses:
AbstractClassMappingImpl,AbstractMemberMappingImpl
public abstract class AbstractMappingImpl<M extends Mapping,P> extends java.lang.Object implements Mapping<M,P>
An abstract basic implementation ofMapping.- Since:
- 0.2.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMappingImpl(MappingSet mappings, java.lang.String obfuscatedName, java.lang.String deobfuscatedName)Creates a new de-obfuscation mapping, based on the given obfuscated name and de-obfuscated name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.StringJoinerbuildToString()booleanequals(java.lang.Object obj)<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.MappingSetgetMappings()Gets theMappingSetthat the mappings belongs to.java.lang.StringgetObfuscatedName()Gets the obfuscated name of the member being represented.booleanhasDeobfuscatedName()Establishes whether the mapping has had a de-obfuscated name set.inthashCode()<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.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cadixdev.lorenz.model.Mapping
copy, getFullDeobfuscatedName, getFullObfuscatedName, getOrCreate, getSimpleDeobfuscatedName, getSimpleObfuscatedName, merge
-
Methods inherited from interface org.cadixdev.lorenz.util.Reversible
reverse
-
-
-
-
Constructor Detail
-
AbstractMappingImpl
protected AbstractMappingImpl(MappingSet mappings, java.lang.String obfuscatedName, java.lang.String deobfuscatedName)
Creates a new de-obfuscation mapping, based on the given obfuscated name and de-obfuscated name.- Parameters:
mappings- The mappings set, this mapping belongs toobfuscatedName- The obfuscated namedeobfuscatedName- The de-obfuscated name
-
-
Method Detail
-
getObfuscatedName
public java.lang.String getObfuscatedName()
Description copied from interface:MappingGets the obfuscated name of the member being represented.- Specified by:
getObfuscatedNamein interfaceMapping<M extends Mapping,P>- Returns:
- The obfuscated name
-
getDeobfuscatedName
public java.lang.String getDeobfuscatedName()
Description copied from interface:MappingGets the de-obfuscated name of the member being represented. This can be altered through use ofMapping.setDeobfuscatedName(String).- Specified by:
getDeobfuscatedNamein interfaceMapping<M extends Mapping,P>- Returns:
- The de-obfuscated name
-
setDeobfuscatedName
public M setDeobfuscatedName(java.lang.String deobfuscatedName)
Description copied from interface:MappingSets the de-obfuscated name of the member.- Specified by:
setDeobfuscatedNamein interfaceMapping<M extends Mapping,P>- Parameters:
deobfuscatedName- The new de-obfuscated name- Returns:
thisfor chaining
-
hasDeobfuscatedName
public boolean hasDeobfuscatedName()
Description copied from interface:MappingEstablishes whether the mapping has had a de-obfuscated name set.- Specified by:
hasDeobfuscatedNamein interfaceMapping<M extends Mapping,P>- Returns:
Trueif the mapping is mapped,falseotherwise
-
getMappings
public MappingSet getMappings()
Description copied from interface:MappingGets theMappingSetthat the mappings belongs to.- Specified by:
getMappingsin interfaceMapping<M extends Mapping,P>- Returns:
- The owning mapping set
-
get
public <T> java.util.Optional<T> get(ExtensionKey<T> key)
Description copied from interface:MappingGets the value of the extension data, if it exists.
-
set
public <T> void set(ExtensionKey<T> key, T value)
Description copied from interface:MappingSets the given extension data to the given value.
-
buildToString
protected java.util.StringJoiner buildToString()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-