Package pl.edu.icm.unity.types.basic
Class AttributesClass
- java.lang.Object
-
- pl.edu.icm.unity.types.DescribedObjectROImpl
-
- pl.edu.icm.unity.types.DescribedObjectImpl
-
- pl.edu.icm.unity.types.basic.AttributesClass
-
- All Implemented Interfaces:
DescribedObject
,NamedObject
public class AttributesClass extends DescribedObjectImpl
Represents attribute class, i.e. a structure with two sets of attribute types. The mandatory set defines which attributes are mandatory for an entity having the class and allowed - which are allowed. It is possible to set that all attributes are allowed. All mandatory attributes are always allowed.Attribute class can have a parents. Then all mandatory and allowed attribute types of the parent are added to those defined locally.
Attribute class inheritance can be multilevel.
Attribute class is always assigned in a scope of a particular group, but the group is not defined in the class itself, i.e. the class can be used in many groups.
If an entity has multiple attribute classes assigned in some group, then all sets are summed up. If any of the classes allows for arbitrary attributes, then effectively all attributes are allowed.
All mandatory attributes are always allowed.
This class uses the default JSON serialization.
- Author:
- K. Benedyczak
-
-
Field Summary
-
Fields inherited from class pl.edu.icm.unity.types.DescribedObjectROImpl
description, name
-
-
Constructor Summary
Constructors Constructor Description AttributesClass()
Creates an empty, anonymous AC: nothing is required nor allowedAttributesClass(String name, String description, Set<String> allowed, Set<String> mandatory, boolean allowArbitrary, Set<String> parentClasses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributesClass
clone()
boolean
equals(Object obj)
Set<String>
getAllowed()
Set<String>
getMandatory()
Set<String>
getParentClasses()
int
hashCode()
boolean
isAllowArbitrary()
boolean
isAllowedDirectly(String type)
boolean
isMandatoryDirectly(String type)
void
setAllowArbitrary(boolean allowArbitrary)
void
setAllowed(Set<String> allowed)
void
setMandatory(Set<String> mandatory)
void
setParentClasses(Set<String> parentClasses)
String
toString()
-
Methods inherited from class pl.edu.icm.unity.types.DescribedObjectImpl
setDescription, setName
-
Methods inherited from class pl.edu.icm.unity.types.DescribedObjectROImpl
fromJsonDescObj, getDescription, getName, toJson
-
-
-
-
Method Detail
-
clone
public AttributesClass clone()
-
isAllowedDirectly
public boolean isAllowedDirectly(String type)
-
isMandatoryDirectly
public boolean isMandatoryDirectly(String type)
-
isAllowArbitrary
public boolean isAllowArbitrary()
-
setAllowArbitrary
public void setAllowArbitrary(boolean allowArbitrary)
-
toString
public String toString()
- Overrides:
toString
in classDescribedObjectROImpl
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDescribedObjectROImpl
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classDescribedObjectROImpl
-
-