Enum Class PackageMode

java.lang.Object
java.lang.Enum<PackageMode>
com.perfino.annotation.PackageMode
All Implemented Interfaces:
Serializable, Comparable<PackageMode>, Constable

public enum PackageMode extends Enum<PackageMode>
Specifies the way package names are treated when adding class names to a transaction name. When constructing the naming of a transaction, Part.Type.CLASS and Part.Type.INSTANCE_CLASS add the name of a class to the transaction name. With the Part.packageMode() parameter of the @Part annotation you can control if and how package names should be added.

The default value is NONE, so if do you not wish to add any package information, you do not have to configure anything.

  • Enum Constant Details

    • NONE

      public static final PackageMode NONE
      No package information is added, just the simple class name. For example, if the class is com.mycorp.MyClass, the string "MyClass" is added.

      This is the default value and does not have to be specified explicitly

    • ABBREVIATED

      public static final PackageMode ABBREVIATED
      Packages are appended in abbreviated mode. Each package name component is replaced by its first character. For example, if the class is com.mycorp.MyClass, the string "c.m.MyClass" is added.

      This is useful if you want to distinguish several classes with the same name in different packages.

    • FULL

      public static final PackageMode FULL
      Packages are appended in full. For example, if the class is com.mycorp.MyClass, the fully qualified name "com.mycorp.MyClass" is added.
  • Method Details

    • values

      public static PackageMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PackageMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null