Class MiniBundle
- java.lang.Object
-
- com.opencloud.rhino.facilities.sas.bundle.Bundle
-
- com.opencloud.rhino.facilities.sas.bundle.MiniBundle
-
- All Implemented Interfaces:
Comparable<MiniBundle>
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.
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<String>
VERSION_COMPARATOR
Ruby style version string comparator.
-
Constructor Summary
Constructors Constructor Description MiniBundle()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
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.
-
-
Method Detail
-
getEvents
public SortedMap<EventKey,EventDescription> getEvents()
-
setEvents
public void setEvents(SortedMap<EventKey,EventDescription> events)
-
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 interfaceComparable<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
-
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
-
-
-