com.pega.pegarules.pub.util
Interface RuleSetSpecification

All Superinterfaces:
java.lang.Comparable
All Known Subinterfaces:
RuleSet

public interface RuleSetSpecification
extends java.lang.Comparable

An immutable representation of a ruleset specification. A ruleset specification corresponds to one or more specific ruleset versions.

The text representation of a ruleset specification looks like

name[:[(xx[-yy[-zz]]) | *]]
where xx, yy, and zz are two-digit numbers.

The following are valid ruleset specifications:

My-Ruleset
Represents any version of ruleset My-Ruleset.
My-Ruleset:
Represents any version of ruleset My-Ruleset.
My-Ruleset:*
Represents any version of ruleset My-Ruleset.
My-Ruleset:02
Represents any version of ruleset My-Ruleset with major version 2.
My-Ruleset:02-03
Represents any version of ruleset My-Ruleset with major version 2 and minor version 3 or below.
My-Ruleset:02-03-04
Represents any version of ruleset My-Ruleset with major version 2 and and minor and revision version at or below 3.4.

The toString method returns a standard string representation of this ruleset specification.

Version:
$Revision: 26225 $ $Date: 2012-04-25 18:19:03 -0400 (Wed, 25 Apr 2012) $
Author:
Jamie Gentry

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String sBaseRulesetName
          The "base" RuleSet name.
static java.lang.String VERSION
           
 
Method Summary
 boolean compareNameAndMajorVersion(java.lang.Object aOther)
          Compares another ruleset's name and major version to this ruleset.
 int compareTo(java.lang.Object aRuleSet)
          Compares another ruleset to this.
 boolean equals(java.lang.Object aRuleset)
          Returns true iff this and the given ruleset instance describe the same ruleset.
 int getMajorVersion()
          Gets the major version.
 int getMinorVersion()
          Gets the minor version.
 java.lang.String getName()
          Returns the ruleset name.
 int getRevision()
          Gets the revision.
 java.lang.String getRuleSetType()
           
 java.lang.String getVersionString()
          Returns the version, as a string.
 boolean isPersonal()
          if this ruleset is a personal one (contains an '@') return true.
 boolean isRulesetIncluded(RuleSetSpecification aRuleset)
          Returns true if this ruleset includes the given specification.
 boolean isTypeBranch()
           
 boolean isTypeBranchPegaOrPega()
           
 boolean isTypeComponent()
           
 boolean isTypeOverride()
           
 boolean isTypePega()
           
 boolean isTypeProduction()
           
 boolean isTypeShared()
           
 boolean isTypeStandard()
           
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values

sBaseRulesetName

static final java.lang.String sBaseRulesetName
The "base" RuleSet name.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns the ruleset name.

Returns:
the name

getMajorVersion

int getMajorVersion()
Gets the major version.

Returns:
the major version number, or a negative number if none is specified

getMinorVersion

int getMinorVersion()
Gets the minor version.

Returns:
the minor version number, or a negative number if none is specified

getRevision

int getRevision()
Gets the revision.

Returns:
the revision version number, or a negative number if none is specified

isPersonal

boolean isPersonal()
if this ruleset is a personal one (contains an '@') return true.

Returns:
true if the rulesetname contains an '@', false otherwise

compareTo

int compareTo(java.lang.Object aRuleSet)
Compares another ruleset to this. Both rulesets must have the same name.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
aRuleSet - the ruleset to compare to this
Returns:
a positive number if this has a higher version than aRuleset; zero if they are the same version; or a negative number if aRuleset has a higher version

compareNameAndMajorVersion

boolean compareNameAndMajorVersion(java.lang.Object aOther)
Compares another ruleset's name and major version to this ruleset.

Parameters:
aOther - the ruleset to compare to this
Returns:
true iff both name and major version are the same

equals

boolean equals(java.lang.Object aRuleset)
Returns true iff this and the given ruleset instance describe the same ruleset.

Overrides:
equals in class java.lang.Object
Parameters:
aRuleset - the ruleset to compare this to. This must be a RuleSetSpecification or another RuleSet. If it is a RuleSetSpecification, then it is equal to this ruleset only if it has all three version parts specified, they match the version parts of this ruleset.
Returns:
true iff the two instances describe the same RuleSet

isRulesetIncluded

boolean isRulesetIncluded(RuleSetSpecification aRuleset)
Returns true if this ruleset includes the given specification.

Parameters:
aRuleset - the ruleset to check
Returns:
result

getVersionString

java.lang.String getVersionString()
Returns the version, as a string.

Returns:
the version (not including the colon). For example, for a RuleSet specification My-RuleSet:02-03, 02-03 would be returned. If the specification does not include any version information, then an empty string is returned.

isTypeOverride

boolean isTypeOverride()

isTypeBranch

boolean isTypeBranch()

isTypeStandard

boolean isTypeStandard()

getRuleSetType

java.lang.String getRuleSetType()

isTypeShared

boolean isTypeShared()

isTypeComponent

boolean isTypeComponent()

isTypePega

boolean isTypePega()

isTypeProduction

boolean isTypeProduction()

isTypeBranchPegaOrPega

boolean isTypeBranchPegaOrPega()


Copyright © 2012 Pegasystems Inc. All Rights Reserved.