Class LevelIdentifier

java.lang.Object
com.activeviam.copper.LevelIdentifier
All Implemented Interfaces:
Serializable

public final class LevelIdentifier extends Object implements Serializable
The identifier of a level in a cube.
Author:
ActiveViam
See Also:
  • Field Details

    • parent

      public final HierarchyIdentifier parent
      The identifier of the hierarchy containing this level.
    • level

      public final String level
      The level name.
  • Constructor Details

    • LevelIdentifier

      public LevelIdentifier(String dimension, String hierarchy, String level)
      Constructor.
      Parameters:
      dimension - the dimension name
      hierarchy - the hierarchy name
      level - the level name
    • LevelIdentifier

      public LevelIdentifier(HierarchyIdentifier hierarchy, String level)
      Constructor.
      Parameters:
      hierarchy - the parent hierarchy identifier
      level - the level name
  • Method Details

    • simple

      public static LevelIdentifier simple(String level)
      Creates an identifier for a level belonging to a simple hierarchy where level, hierarchy and dimension share the same name.
      Parameters:
      level - name of the level
      Returns:
      created identifier
    • getHierarchy

      public HierarchyIdentifier getHierarchy()
      Gets the hierarchy of the level.
      Returns:
      the hierarchy of the level
    • toDescription

      public String toDescription()
      Converts this level identifier to a string of the form levelName@hierarchyName@dimensionName to be used in String based descriptions.
      Returns:
      the levelName@hierarchyName@dimensionName String
    • toDescription

      public static String toDescription(String dimension, String hierarchy, String level)
      Converts this level identifier to a string of the form levelName@hierarchyName@dimensionName to be used in String based descriptions.
      Parameters:
      dimension - the dimension name
      hierarchy - the hierarchy name
      level - the level name
      Returns:
      the levelName@hierarchyName@dimensionName String
      See Also:
    • fromDescription

      public static LevelIdentifier fromDescription(@NonNull @NonNull String description)
      Parses a description of the form levelName@hierarchyName@dimensionName to create an identifier from it.
      Parameters:
      description - the description to parse, caller should ensure this description is valid, in case of malformed input the returned LevelIdentifier will be inconsistent
      Returns:
      the identifier extracted from the description
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object