public class MiniBundle extends Bundle implements Comparable<MiniBundle>
A mini-bundle is a fragment of a SAS bundle with an independent version and partial event ids.
Modifier and Type | Field and Description |
---|---|
static Comparator<String> |
VERSION_COMPARATOR
Ruby style version string comparator.
|
Constructor and Description |
---|
MiniBundle() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MiniBundle o)
Compare using prefix or, if unavailable, name and version only.
|
boolean |
equals(Object o)
Returns true if this mini-bundle has exactly the same name, version, events and enums as the other.
|
SortedMap<EventKey,EventDescription> |
getEvents() |
String |
getName() |
Integer |
getPrefix() |
String |
getVersion() |
int |
hashCode() |
static String |
inferPackageName(Path bundlePath) |
boolean |
isSuperset(MiniBundle olderBundle)
Check if this mini-bundle is a superset of the older one.
|
void |
setEvents(SortedMap<EventKey,EventDescription> events) |
void |
setName(String name) |
void |
setPrefix(Integer prefix) |
void |
setVersion(String version) |
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.
public SortedMap<EventKey,EventDescription> getEvents()
public void setEvents(SortedMap<EventKey,EventDescription> events)
public Integer getPrefix()
public void setPrefix(Integer prefix)
public String getVersion()
public void setVersion(String version)
public String getName()
public void setName(String name)
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.
compareTo
in interface Comparable<MiniBundle>
o
- 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
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.
olderBundle
-