All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.agent.debug.VariableNameEncoder Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package org.snapscript.agent.debug;

public class VariableNameEncoder {

   private static final String DEFAULT_TOKEN = "__DOT__";
   
   private final String token;
   
   public VariableNameEncoder() {
      this(DEFAULT_TOKEN);
   }
   
   public VariableNameEncoder(String token) {
      this.token = token;
   }
   
   public String encode(String name) {
      if(name != null) {
         return name.replace(".", token);
      }
      return name;
   }
   
   public String decode(String name) {
      if(name != null) {
         return name.replace(token, ".");
      }
      return name;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy