Class FullMappingsBase
java.lang.Object
com.viaversion.viaversion.api.data.FullMappingsBase
- All Implemented Interfaces:
BiMappings,FullMappings,Mappings
- Direct Known Subclasses:
FullIdentityMappings,LegacyFullStringMappingsBase,ParticleMappings
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionFullMappingsBase(MappingDataLoader.IdentifiersPair identifiersPair, Mappings mappings) protectedFullMappingsBase(it.unimi.dsi.fastutil.objects.Object2IntMap<String> stringToId, it.unimi.dsi.fastutil.objects.Object2IntMap<String> mappedStringToId, Key[] idToKey, Key[] mappedIdToKey, Mappings mappings) -
Method Summary
Modifier and TypeMethodDescriptionintgetNewId(int id) Returns the mapped id from the given id, or -1 if invalid/out of bounds.intReturns the unmapped integer id for the given identifier, or -1 if not found.inverse()Returns the inverse of the bimappings.booleanReturns whether the int id mappings are identity mappings.@Nullable KeykeyFromId(int id) Returns the unmapped key for the given mapped id.@Nullable KeykeyFromMappedKey(String mappedIdentifier) Returns the unmapped key for the given mapped identifier.intReturns the mapped integer id for the given mapped identifier, or -1 if not found.@Nullable KeymappedKeyFromKey(String identifier) Returns the mapped key for the given unmapped identifier.@Nullable KeymappedKeyFromMappedId(int mappedId) Returns the mapped key for the given mapped id.intReturns the amount of new ids total, even if it does not have a direct mapping.static FullMappingsof(MappingDataLoader.IdentifiersPair identifiersPair, Mappings mappings) voidsetNewId(int id, int mappedId) Manually maps a specific id.intsize()Returns amount of unmapped entries, being the size of the mapping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.viaversion.viaversion.api.data.FullMappings
identifier, identifier, mappedIdentifier, mappedIdentifierMethods inherited from interface com.viaversion.viaversion.api.data.Mappings
contains, getNewIdOrDefault, isIdentity
-
Field Details
-
stringToId
-
mappedStringToId
-
idToKey
-
mappedIdToKey
-
mappings
-
-
Constructor Details
-
FullMappingsBase
-
FullMappingsBase
-
-
Method Details
-
of
-
id
Description copied from interface:FullMappingsReturns the unmapped integer id for the given identifier, or -1 if not found.- Specified by:
idin interfaceFullMappings- Parameters:
identifier- unmapped string identifier- Returns:
- unmapped int id, or -1 if not found
-
mappedId
Description copied from interface:FullMappingsReturns the mapped integer id for the given mapped identifier, or -1 if not found.- Specified by:
mappedIdin interfaceFullMappings- Parameters:
mappedIdentifier- mapped string identifier- Returns:
- mapped int id, or -1 if not found
-
keyFromId
Description copied from interface:FullMappingsReturns the unmapped key for the given mapped id.- Specified by:
keyFromIdin interfaceFullMappings- Parameters:
id- unmapped id- Returns:
- unmapped key, or null if out of bounds
-
keyFromMappedKey
Description copied from interface:FullMappingsReturns the unmapped key for the given mapped identifier.- Specified by:
keyFromMappedKeyin interfaceFullMappings- Parameters:
mappedIdentifier- mapped identifier- Returns:
- unmapped key, or null if not found
-
mappedKeyFromMappedId
Description copied from interface:FullMappingsReturns the mapped key for the given mapped id.- Specified by:
mappedKeyFromMappedIdin interfaceFullMappings- Parameters:
mappedId- mapped id- Returns:
- mapped key, or null if out of bounds
-
mappedKeyFromKey
Description copied from interface:FullMappingsReturns the mapped key for the given unmapped identifier.- Specified by:
mappedKeyFromKeyin interfaceFullMappings- Parameters:
identifier- unmapped identifier- Returns:
- mapped key, or null if not found
-
getNewId
public int getNewId(int id) Description copied from interface:MappingsReturns the mapped id from the given id, or -1 if invalid/out of bounds. -
setNewId
public void setNewId(int id, int mappedId) Description copied from interface:MappingsManually maps a specific id. -
size
public int size()Description copied from interface:MappingsReturns amount of unmapped entries, being the size of the mapping. -
mappedSize
public int mappedSize()Description copied from interface:MappingsReturns the amount of new ids total, even if it does not have a direct mapping. Returns -1 if unknown.- Specified by:
mappedSizein interfaceMappings- Returns:
- amount of new ids, or -1 if unknown
-
isIntIdIdentity
public boolean isIntIdIdentity()Description copied from interface:FullMappingsReturns whether the int id mappings are identity mappings.- Specified by:
isIntIdIdentityin interfaceFullMappings- Returns:
- whether the int id mappings are identity mappings
- See Also:
-
inverse
Description copied from interface:BiMappingsReturns the inverse of the bimappings.- Specified by:
inversein interfaceBiMappings- Specified by:
inversein interfaceFullMappings- Specified by:
inversein interfaceMappings- Returns:
- inverse of the bimappings
-