Package com.cedarpolicy.model.slice
Class BasicSlice
java.lang.Object
com.cedarpolicy.model.slice.BasicSlice
- All Implemented Interfaces:
Slice
A basic implementation of the Slice interface that holds the policies, attributes, and parents
maps in memory.
-
Constructor Summary
ConstructorsConstructorDescriptionBasicSlice(Set<Policy> policies, Set<Entity> entities) Construct a Slice from Entity and Policy objects.BasicSlice(Set<Policy> policies, Set<Entity> entities, Set<Policy> templates, List<TemplateInstantiation> templateInstantiations) Construct a Slice from Entity and Policy objects. -
Method Summary
Modifier and TypeMethodDescriptionGet the attribute map.Get the entities.Get the parent map.Get the policy set.Get the template instantiations.Get the template policies.toString()
-
Constructor Details
-
BasicSlice
public BasicSlice(Set<Policy> policies, Set<Entity> entities, Set<Policy> templates, List<TemplateInstantiation> templateInstantiations) Construct a Slice from Entity and Policy objects.- Parameters:
policies- Set of policies.entities- Set of entities.templates- Set of policy templates.templateInstantiations- List of TemplateInstantiations.
-
BasicSlice
Construct a Slice from Entity and Policy objects.- Parameters:
policies- Set of policies.entities- Set of entities.
-
-
Method Details
-
getPolicies
Description copied from interface:SliceGet the policy set.- Specified by:
getPoliciesin interfaceSlice- Returns:
- Map from policyIDs to Policy source strings.
-
getAttributes
Description copied from interface:SliceGet the attribute map.- Specified by:
getAttributesin interfaceSlice- Returns:
- Map from EUIDs to attribute key/value maps.
-
getParents
Description copied from interface:SliceGet the parent map.- Specified by:
getParentsin interfaceSlice- Returns:
- Map from EUIDs to parent EUIDs.
-
getEntities
Description copied from interface:SliceGet the entities.- Specified by:
getEntitiesin interfaceSlice- Returns:
- Set of Entities.
-
getTemplates
Description copied from interface:SliceGet the template policies.- Specified by:
getTemplatesin interfaceSlice- Returns:
- Map from template policy ID to template policy
-
getTemplateInstantiations
Description copied from interface:SliceGet the template instantiations.- Specified by:
getTemplateInstantiationsin interfaceSlice- Returns:
- List of template instatiations
-
toString
-