Package com.nomagic.magicdraw.annotation
Class AnnotationSubset
- java.lang.Object
-
- com.nomagic.magicdraw.annotation.AnnotationSubset
-
@OpenApiAll public final class AnnotationSubset extends java.lang.Object
Defines a subset of registered annotations. Used to filter annotations when retrieving them from theAnnotationManager
AnnotationSubset.ALL
means any registered annotation.
-
-
Field Summary
Fields Modifier and Type Field Description static AnnotationSubset
ALL
private java.util.Comparator<Annotation>
comparator
private java.util.Collection<AnnotationCategory>
excluded
private int
hashCode
private java.util.Collection<AnnotationCategory>
included
-
Constructor Summary
Constructors Constructor Description AnnotationSubset(java.util.Collection<AnnotationCategory> included, java.util.Collection<AnnotationCategory> excluded, java.util.Comparator<Annotation> comparator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AnnotationSubset
allExcluding(java.util.Collection<AnnotationCategory> excludedCategories, java.util.Comparator<Annotation> comparator)
boolean
containsCategory(AnnotationCategory category)
boolean
equals(java.lang.Object o)
java.util.Comparator<Annotation>
getComparator()
java.util.Collection<AnnotationCategory>
getExcludedCategories()
Excluded categories, that are strictly not contained by this subset If category is both included and excluded, it is still not contained by this subsetjava.util.Collection<AnnotationCategory>
getIncludedCategories()
If included categories are empty, then every possible category is contained by this subset, except the excluded ones.int
hashCode()
static AnnotationSubset
includingOnly(java.util.Collection<AnnotationCategory> includedCategories, java.util.Comparator<Annotation> comparator)
-
-
-
Field Detail
-
ALL
public static final AnnotationSubset ALL
-
included
private final java.util.Collection<AnnotationCategory> included
-
excluded
private final java.util.Collection<AnnotationCategory> excluded
-
comparator
private final java.util.Comparator<Annotation> comparator
-
hashCode
private final int hashCode
-
-
Constructor Detail
-
AnnotationSubset
public AnnotationSubset(java.util.Collection<AnnotationCategory> included, java.util.Collection<AnnotationCategory> excluded, @CheckForNull java.util.Comparator<Annotation> comparator)
-
-
Method Detail
-
allExcluding
public static AnnotationSubset allExcluding(java.util.Collection<AnnotationCategory> excludedCategories, @CheckForNull java.util.Comparator<Annotation> comparator)
-
includingOnly
public static AnnotationSubset includingOnly(java.util.Collection<AnnotationCategory> includedCategories, @CheckForNull java.util.Comparator<Annotation> comparator)
- Returns:
- AnnotationSubset for any annotation group with the given scope
-
containsCategory
public boolean containsCategory(AnnotationCategory category)
- Returns:
- true if the given annotation category belongs to this subset
-
getIncludedCategories
public java.util.Collection<AnnotationCategory> getIncludedCategories()
If included categories are empty, then every possible category is contained by this subset, except the excluded ones.
-
getExcludedCategories
public java.util.Collection<AnnotationCategory> getExcludedCategories()
Excluded categories, that are strictly not contained by this subset If category is both included and excluded, it is still not contained by this subset
-
getComparator
@CheckForNull public java.util.Comparator<Annotation> getComparator()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-