Class MiniBundle

    • Field Detail

      • VERSION_COMPARATOR

        public static final Comparator<String> VERSION_COMPARATOR

        Ruby style version string comparator. Sorts versions of the form X.Y.Z…​ where X, Y and Z are alphanumeric values.

    • Constructor Detail

      • MiniBundle

        public MiniBundle()
    • Method Detail

      • getPrefix

        public Integer getPrefix()
      • setPrefix

        public void setPrefix​(Integer prefix)
      • getVersion

        public String getVersion()
      • setVersion

        public void setVersion​(String version)
      • getName

        public String getName()
      • setName

        public void setName​(String name)
      • compareTo

        public int compareTo​(MiniBundle o)

        Compare using prefix or, if unavailable, name and version only. Prefix comparison is preferred when available because events should be added to the merged bundle in prefix order for readability. equals(Object) compares all fields except prefix because having multiple names attached to one prefix is an error.

        Specified by:
        compareTo in interface Comparable<MiniBundle>
        Parameters:
        o -
        Returns:
      • equals

        public boolean equals​(Object o)

        Returns true if this mini-bundle has exactly the same name, version, events and enums as the other. The order of events must be the same for both mini-bundles to be equal. Prefix is not compared because prefixes are assigned after creation from a name→prefix map

        Overrides:
        equals in class Bundle
        Parameters:
        o -
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isSuperset

        public boolean isSuperset​(MiniBundle olderBundle)

        Check if this mini-bundle is a superset of the older one. Accepts a non-strict superset of events and enums. Performs an ordered comparison. Named events in bundles must not be rearranged.

        Parameters:
        olderBundle -
      • inferPackageName

        public static String inferPackageName​(Path bundlePath)