Class PathUtils


  • public class PathUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      PathUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String checkAndReturnSingleMeasurement​(java.lang.String measurement)
      check a measurement and update it if needed to.
      static java.util.List<java.util.List<java.lang.String>> checkIsLegalMeasurementListsAndUpdate​(java.util.List<java.util.List<java.lang.String>> measurementLists)
      check whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?
      static java.util.List<java.lang.String> checkIsLegalMeasurementsAndUpdate​(java.util.List<java.lang.String> measurements)
      check whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?
      static java.util.List<java.util.List<java.lang.String>> checkIsLegalSingleMeasurementListsAndUpdate​(java.util.List<java.util.List<java.lang.String>> measurementLists)
      check whether measurement is legal according to syntax convention.
      static java.util.List<java.lang.String> checkIsLegalSingleMeasurementsAndUpdate​(java.util.List<java.lang.String> measurements)
      check whether measurement is legal according to syntax convention.
      static java.util.List<java.lang.String> checkLegalSingleMeasurementsAndSkipDuplicate​(java.util.List<java.lang.String> measurements, java.util.Map<java.lang.String,​java.lang.String> checkedMeasurements)
      check whether measurement is legal according to syntax convention.
      static java.lang.String[] isLegalPath​(java.lang.String path)  
      static boolean isRealNumber​(java.lang.String str)
      Return true if the str is a real number.
      static boolean isStartWith​(java.lang.String deviceName, java.lang.String storageGroup)  
      static java.lang.String removeBackQuotesIfNecessary​(java.lang.String measurement)
      Remove the back quotes of a measurement if necessary
      static java.lang.String[] splitPathToDetachedNodes​(java.lang.String path)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PathUtils

        public PathUtils()
    • Method Detail

      • splitPathToDetachedNodes

        public static java.lang.String[] splitPathToDetachedNodes​(java.lang.String path)
                                                           throws IllegalPathException
        Parameters:
        path - the path will split. ex, root.ln.
        Returns:
        string array. ex, [root, ln]
        Throws:
        IllegalPathException - if path isn't correct, the exception will throw
      • checkIsLegalSingleMeasurementListsAndUpdate

        public static java.util.List<java.util.List<java.lang.String>> checkIsLegalSingleMeasurementListsAndUpdate​(java.util.List<java.util.List<java.lang.String>> measurementLists)
                                                                                                            throws MetadataException
        check whether measurement is legal according to syntax convention. Measurement can only be a single node name. The returned list is updated, could be different from the original list.
        Throws:
        MetadataException
      • checkLegalSingleMeasurementsAndSkipDuplicate

        public static java.util.List<java.lang.String> checkLegalSingleMeasurementsAndSkipDuplicate​(java.util.List<java.lang.String> measurements,
                                                                                                    java.util.Map<java.lang.String,​java.lang.String> checkedMeasurements)
                                                                                             throws MetadataException
        check whether measurement is legal according to syntax convention. Measurement can only be a single node name, use set to skip checking duplicated measurements
        Throws:
        MetadataException
      • checkIsLegalSingleMeasurementsAndUpdate

        public static java.util.List<java.lang.String> checkIsLegalSingleMeasurementsAndUpdate​(java.util.List<java.lang.String> measurements)
                                                                                        throws MetadataException
        check whether measurement is legal according to syntax convention. Measurement can only be a single node name.
        Throws:
        MetadataException
      • checkIsLegalMeasurementListsAndUpdate

        public static java.util.List<java.util.List<java.lang.String>> checkIsLegalMeasurementListsAndUpdate​(java.util.List<java.util.List<java.lang.String>> measurementLists)
                                                                                                      throws IllegalPathException
        check whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?
        Throws:
        IllegalPathException
      • checkIsLegalMeasurementsAndUpdate

        public static java.util.List<java.lang.String> checkIsLegalMeasurementsAndUpdate​(java.util.List<java.lang.String> measurements)
                                                                                  throws IllegalPathException
        check whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?
        Throws:
        IllegalPathException
      • checkAndReturnSingleMeasurement

        public static java.lang.String checkAndReturnSingleMeasurement​(java.lang.String measurement)
                                                                throws IllegalPathException
        check a measurement and update it if needed to. for example: `sd` -> sd
        Throws:
        IllegalPathException
      • isRealNumber

        public static boolean isRealNumber​(java.lang.String str)
        Return true if the str is a real number. Examples: 1.0; +1.0; -1.0; 0011; 011e3; +23e-3
      • isStartWith

        public static boolean isStartWith​(java.lang.String deviceName,
                                          java.lang.String storageGroup)
      • removeBackQuotesIfNecessary

        public static java.lang.String removeBackQuotesIfNecessary​(java.lang.String measurement)
        Remove the back quotes of a measurement if necessary