public class ExclusionsDefinition extends BaseMetadata implements Serializable
Exclusion
objects as a
single unit.
Instances of ExclusionsDefinition
are persisted in the metadata
repository which makes it a sharable object across Schedule
definitions.
An example is list of holidays represented as one instance of an
ExclusionsDefinition
object that contains all the individual
holidays represented by instances of Exclusion
class.
A Schedule
then refer to this holidays to skip any occurrences
that happen on any of these holidays.
Exclusion
,
Schedule
,
Serialized FormConstructor and Description |
---|
ExclusionsDefinition(String name,
String description,
Collection exclusions)
Constructs a new instance with the given collection of exclusions.
|
ExclusionsDefinition(String name,
String displayNameKey,
String descriptionKey,
Collection exclusions,
String[] resourceBundleIDs)
Constructs a new instance with the given collection of exclusions.
|
Modifier and Type | Method and Description |
---|---|
void |
addExclusion(Exclusion exclusion)
Add an exclusion to this object.
|
ExclusionsDefinition |
clone(String newName) |
boolean |
equals(Object obj)
Compares an object for equality with this ExclusionsDefinition object.
|
BaseMetadataType |
getBaseMetadataType()
Gets the intended type of this metadata.
|
Collection |
getExclusions()
Gets the list of exclusions of this object.
|
boolean |
isExcluded(Calendar start,
Calendar date)
Check if a given date fall in the list of exclusions contained
within this
ExclusionsDefinition instance. |
void |
removeExclusion(Exclusion exclusion)
Removes an Exclusion from this ExclusionsDefinition object.
|
void |
setExclusions(Collection exclusions)
Sets the list of exclusions of this object.
|
getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMetadataObjectId, getName, getResourceBundles, hashCode, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, toString, validate
public ExclusionsDefinition(String name, String description, Collection exclusions)
name
- the name for this instance. It cannot be null.
The name is also used as the default display name.description
- an optional description string.exclusions
- collection of exclusions instances for the
new instance.public ExclusionsDefinition(String name, String displayNameKey, String descriptionKey, Collection exclusions, String[] resourceBundleIDs)
name
- the bame for this instance. It cannot be null.
The name is also used as the default display name unless otherwise
specifically set.displayNameKey
- the resource bundle key for the display name.
Optional.descriptionKey
- the resource bundle key for the description.
Optional.exclusions
- collection of exclusions instances for the
new instance.resourceBundleIDs
- an array of resource bundle ids.
This is optional.public void addExclusion(Exclusion exclusion)
exclusion
- instance of Exclusion to be added to this object.public void removeExclusion(Exclusion exclusion)
exclusion
- the Exclusion instance to be removed from the
exclusions contained in this object.public Collection getExclusions()
public void setExclusions(Collection exclusions)
exclusions
- a collection containing the list of exclusions
to be set for this object.public boolean isExcluded(Calendar start, Calendar date)
ExclusionsDefinition
instance. If found,
it indicates that the given date must be skipped or excluded.
The method takes a starting time as an argument that is used to
generate occurrence if any of the Exclusion
contained in
this object is based on Recurrence
.
start
- the start time for any recurrence based Exclusion.date
- the date to be checked for exclusion.true
of the given date must be excluded, or
false
otherwise.public boolean equals(Object obj)
public BaseMetadataType getBaseMetadataType()
BaseMetadata
getBaseMetadataType
in class BaseMetadata
public ExclusionsDefinition clone(String newName)
clone
in class BaseMetadata