com.intellectualcrafters.plot.util

## Class UUIDHandler

- java.lang.Object
- - com.intellectualcrafters.plot.util.UUIDHandler

-     public class UUIDHandler
      extends java.lang.Object

  This class can be used to efficiently translate UUIDs and names back and forth. It uses three primary methods of achieving this: - Read From Cache - Read from OfflinePlayer objects - Read from (if onlinemode: mojang api) (else: playername hashing) All UUIDs/Usernames will be stored in a map (cache) until the server is restarted.

  You can use getUuidMap() to save the uuids/names to a file (SQLite db for example). Primary methods: getUUID(String name) & getName(UUID uuid) <-- You should ONLY use these. Call startFetch(JavaPlugin plugin) in your onEnable().

  Originally created by:

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UUIDHandler()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `add(StringWrapper name, java.util.UUID uuid)` Add a set to the cache
    `static java.lang.String` | `getName(java.util.UUID uuid)`
    `static java.util.UUID` | `getUUID(java.lang.String name)`
    `static com.google.common.collect.BiMap<StringWrapper,java.util.UUID>` | `getUuidMap()` Get the map containing all names/uuids
    `static void` | `handleSaving()` Handle saving of uuids
    `static boolean` | `nameExists(StringWrapper name)` Check if a name is cached
    `static boolean` | `uuidExists(java.util.UUID uuid)` Check if a uuid is cached

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UUIDHandler

          public UUIDHandler()

  - ### Method Detail

    - #### getUuidMap

          public static com.google.common.collect.BiMap<StringWrapper,java.util.UUID> getUuidMap()

      Get the map containing all names/uuids
      Returns:
        map with names + uuids

    - #### uuidExists

          public static boolean uuidExists(java.util.UUID uuid)

      Check if a uuid is cached
      Parameters:
        `uuid` - to check
      Returns:
        true of the uuid is cached

    - #### nameExists

          public static boolean nameExists(StringWrapper name)

      Check if a name is cached
      Parameters:
        `name` - to check
      Returns:
        true of the name is cached

    - #### add

          public static void add(StringWrapper name,
                 java.util.UUID uuid)

      Add a set to the cache
      Parameters:
        `name` - to cache
        `uuid` - to cache

    - #### getUUID

          public static java.util.UUID getUUID(java.lang.String name)

      Parameters:
        `name` - to use as key
      Returns:
        uuid

    - #### getName

          public static java.lang.String getName(java.util.UUID uuid)

      Parameters:
        `uuid` - to use as key
      Returns:
        Name

    - #### handleSaving

          public static void handleSaving()

      Handle saving of uuids
      See Also:
        `UUIDSaver.globalSave(com.google.common.collect.BiMap)`