Class TranslatableName


  • public class TranslatableName
    extends java.lang.Object
    Represents a name that can be translated.
    • Constructor Summary

      Constructors 
      Constructor Description
      TranslatableName​(@NotNull java.lang.String name)
      Create a new TranslatableName that is currently not translated.
      TranslatableName​(com.google.gson.JsonObject jsonObject)
      Load a TranslatableName from a JsonObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.lang.String getName()
      Get the name.
      boolean isTranslated()
      Test if the name is currently translated.
      com.google.gson.JsonObject save()
      Get the JsonObject representation of this TranslatableName.
      void setName​(@NotNull java.lang.String name)
      Set the name.
      void setTranslated​(boolean translated)
      Set the name to be translated.
      java.lang.String toString()
      Get the string representation of this TranslatableName.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TranslatableName

        public TranslatableName​(@NotNull
                                @NotNull java.lang.String name)
        Create a new TranslatableName that is currently not translated.
        Parameters:
        name - The untranslated name.
      • TranslatableName

        public TranslatableName​(com.google.gson.JsonObject jsonObject)
        Load a TranslatableName from a JsonObject.
        Parameters:
        jsonObject - The JsonObject to load from.
    • Method Detail

      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Get the name.
        Returns:
        The name.
      • setName

        public void setName​(@NotNull
                            @NotNull java.lang.String name)
        Set the name.
        Parameters:
        name - The name.
      • isTranslated

        public boolean isTranslated()
        Test if the name is currently translated.
        Returns:
        True if the name is currently translated.
      • setTranslated

        public void setTranslated​(boolean translated)
        Set the name to be translated.
        Parameters:
        translated - True if the name should be translated. False if it should not be.
      • save

        public com.google.gson.JsonObject save()
        Get the JsonObject representation of this TranslatableName.
        Returns:
        The JsonObject representation of this TranslatableName.
      • toString

        public java.lang.String toString()
        Get the string representation of this TranslatableName.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The name of this TranslatableName.