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

com.minlia.rocket.problem.ExceptionConverter Maven / Gradle / Ivy

There is a newer version: 2.0.4.1.RELEASE
Show newest version
package com.minlia.rocket.problem;

import org.apache.commons.lang3.StringUtils;

public class ExceptionConverter {


  /**
   * @param code
   * @return
   */
  public static String convert(Object code) {
    String result = "";
    if (null != code) {
      result = String
          .format("%s%s%s", "ExceptionsApiCode", getClassForStatic().getSimpleName(), code);
      result = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(result), ".")
          .toLowerCase();
    }
    return result;
  }

  private static final Class getClassForStatic() {
    return new Object() {
      public Class getClassForStatic() {
        return this.getClass();
      }
    }.getClassForStatic();
  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy