public class AttributeClassHelper extends Object
AttributesClass
es of an entity. A single virtual 'class' is created
from the classes provided as arguments. With it checking of attributes is fast.
Additionally static utility methods are provided allowing to clean up the duplicated entries in ACs.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_CLASSES_PER_ENTITY |
Constructor and Description |
---|
AttributeClassHelper() |
AttributeClassHelper(Map<String,pl.edu.icm.unity.types.basic.AttributesClass> knownClasses,
Collection<String> assignedClasses) |
Modifier and Type | Method and Description |
---|---|
void |
checkAttribtues(Collection<String> attributes,
Map<String,pl.edu.icm.unity.types.basic.AttributeType> allTypes)
Verifies if the given attribute set is consistent with the effective AC
|
static void |
cleanupClass(pl.edu.icm.unity.types.basic.AttributesClass toCleanup,
Map<String,pl.edu.icm.unity.types.basic.AttributesClass> knownClasses)
All parents which are also parents of other existing parents are removed.
|
Set<String> |
getEffectiveAllowed() |
Set<String> |
getEffectiveMandatory() |
boolean |
isAllowed(String attribute) |
boolean |
isEffectiveAllowArbitrary() |
boolean |
isMandatory(String attribute) |
boolean |
isRestricting(AttributeClassHelper original) |
public static final int MAX_CLASSES_PER_ENTITY
public AttributeClassHelper()
public AttributeClassHelper(Map<String,pl.edu.icm.unity.types.basic.AttributesClass> knownClasses, Collection<String> assignedClasses)
public static void cleanupClass(pl.edu.icm.unity.types.basic.AttributesClass toCleanup, Map<String,pl.edu.icm.unity.types.basic.AttributesClass> knownClasses) throws pl.edu.icm.unity.exceptions.IllegalTypeException
knownClasses
- toCleanup
- pl.edu.icm.unity.exceptions.IllegalTypeException
public boolean isRestricting(AttributeClassHelper original)
original
- public void checkAttribtues(Collection<String> attributes, Map<String,pl.edu.icm.unity.types.basic.AttributeType> allTypes) throws pl.edu.icm.unity.exceptions.SchemaConsistencyException
attributes
- allTypes
- if not null, then it is used skip checking of attribute allowance in case of system attributes
(i.e. those with instances immutable flag).pl.edu.icm.unity.exceptions.SchemaConsistencyException
public boolean isAllowed(String attribute)
public boolean isMandatory(String attribute)
public boolean isEffectiveAllowArbitrary()
Copyright © 2019 Unity. All rights reserved.