Class LevelIdentifier

    • Field Detail

      • parent

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

        public final String level
        The level name.
    • Constructor Detail

      • 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 Detail

      • 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
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object