Class g

java.lang.Object
fr.formiko.usuel.g

public class g extends Object
Get a translation class.
Author:
Hydrolien
  • Field Details

    • map

      private static HashMap<String,​String> map
      Contain the Strings in the chosen language.
  • Constructor Details

    • g

      public g()
  • Method Details

    • getMap

      public static HashMap<String,​String> getMap()
    • setMap

      public static void setMap(HashMap<String,​String> m)
    • getElementMap

      public static String getElementMap(String key)
    • get

      public static String get(String f, int x, String s)
      A get methode.
      Difference with main get methode is that key = f+"."+x that's all.
      Parameters:
      s - String return if key is not found.
      Returns:
      value that corresponds to key or s if there is no value fo key.
    • get

      public static String get(String key, String sDefault)
      Main get methode with a replace value if it fail.
      Null values are supported.
      Parameters:
      key - Map key.
      sDefault - String return if key is not found.
      Returns:
      value that corresponds to key or s if there is no value fo key.
    • get

      public static String get(String key)
      Get methode without a replace value if it fail.
      the String return if key is not found will be key.
      Parameters:
      key - Map key.
      Returns:
      value that corresponds to key or key if there is no value fo key.
    • getM

      public static String getM(String key)
      Get methode with 1a char in uppercase.
      return String will have a 1a char in uppercase.
      the String return if key is not found will be key.
      Parameters:
      key - Map key.
      Returns:
      value that corresponds to key or s if there is no value fo key.
    • getM

      public static String getM(String key, String sDefault)
      Get methode with 1a char in uppercase.
      return String will have a 1a char in uppercase.
      the String return if key is not found will be key.
      Parameters:
      key - Map key.
      sDefault - String return if key is not found.
      Returns:
      value that corresponds to key or s if there is no value fo key.
    • getOr

      public static String getOr(String key, String key2)
      A get methode.
      This get methode will return 1 or 2 value split by a / if get(key) & get(key2) do not return the same String.
      Parameters:
      key - Map key1.
      key2 - Map key2.
      Returns:
      value that corresponds to key and key2 or value1/value2 if that's not the same.
    • exist

      public static boolean exist(String key)
      test if key is in the HashMap.
      Parameters:
      key - key to test.
      Returns:
      try if it exist.