Class KingdomsObject<K>

java.lang.Object
org.kingdoms.constants.metadata.KingdomsObject<K>
Direct Known Subclasses:
Group, KingdomItem, KingdomPlayer, Land, Mail, ProtectionSign, Rank

public abstract class KingdomsObject<K> extends Object
If you're using Kotlin, it's highly recommended to build Extension Functions based on KingdomMetadata for the object that you're adding the metadata too. This makes the code much more cleaner.

Similarily, you can also use Extension Methods for Scala.

You don't need to make a separate method for Java calls, since the extensions are still usable when compiled.

  • Field Details

  • Constructor Details

    • KingdomsObject

      protected KingdomsObject()
    • KingdomsObject

      protected KingdomsObject(@NonNull Map<KingdomMetadataHandler,org.kingdoms.constants.metadata.KingdomMetadata> metadata)
  • Method Details

    • compressLocation

      public static @NonNull String compressLocation(org.bukkit.Location location)
    • compressLocation

      public static @NonNull String compressLocation(org.kingdoms.server.location.ImmutableLocation location)
    • compressUUID

      public static @NonNull String compressUUID(UUID id)
    • compressBoolean

      public static @NonNull String compressBoolean(boolean bool)
    • compressString

      public static @NonNull String compressString(String string)
    • compressColor

      public static @NonNull String compressColor(Color color)
    • compressInventory

      public static CharSequence compressInventory(org.bukkit.inventory.Inventory inventory)
    • setMetadata

      public void setMetadata(Map<KingdomMetadataHandler,org.kingdoms.constants.metadata.KingdomMetadata> metadata)
    • compressCollecton

      public static <T> @NonNull String compressCollecton(Collection<T> collection, Function<T,Object> function)
    • compressCollecton

      public static <T> @NonNull String compressCollecton(Collection<T> collection, int mod, Function<T,Object> function)
    • compressMap

      public static <K, V> @NonNull String compressMap(Map<K,V> map, int mod, Function<K,Object> keyCompressor, Function<V,Object> valueCompressor)
    • compressMetadata

      public final @NonNull String compressMetadata()
    • getDataKey

      public abstract @NonNull K getDataKey()
    • getSaveMeta

      public @Nullable String getSaveMeta()
    • setSaveMeta

      public final void setSaveMeta()
    • shouldSave

      public boolean shouldSave()
    • getCompressedData

      public abstract @NonNull String getCompressedData()
    • getMetadata

      public @NonNull Map<KingdomMetadataHandler,org.kingdoms.constants.metadata.KingdomMetadata> getMetadata()