Class BasicSlice

java.lang.Object
com.cedarpolicy.model.slice.BasicSlice
All Implemented Interfaces:
Slice

public class BasicSlice extends Object implements Slice
A basic implementation of the Slice interface that holds the policies, attributes, and parents maps in memory.
  • 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

      public BasicSlice(Set<Policy> policies, Set<Entity> entities)
      Construct a Slice from Entity and Policy objects.
      Parameters:
      policies - Set of policies.
      entities - Set of entities.
  • Method Details

    • getPolicies

      public Map<String,String> getPolicies()
      Description copied from interface: Slice
      Get the policy set.
      Specified by:
      getPolicies in interface Slice
      Returns:
      Map from policyIDs to Policy source strings.
    • getAttributes

      public Map<String,Map<String,Value>> getAttributes()
      Description copied from interface: Slice
      Get the attribute map.
      Specified by:
      getAttributes in interface Slice
      Returns:
      Map from EUIDs to attribute key/value maps.
    • getParents

      public Map<String,List<String>> getParents()
      Description copied from interface: Slice
      Get the parent map.
      Specified by:
      getParents in interface Slice
      Returns:
      Map from EUIDs to parent EUIDs.
    • getEntities

      public Set<Entity> getEntities()
      Description copied from interface: Slice
      Get the entities.
      Specified by:
      getEntities in interface Slice
      Returns:
      Set of Entities.
    • getTemplates

      public Map<String,String> getTemplates()
      Description copied from interface: Slice
      Get the template policies.
      Specified by:
      getTemplates in interface Slice
      Returns:
      Map from template policy ID to template policy
    • getTemplateInstantiations

      public List<TemplateInstantiation> getTemplateInstantiations()
      Description copied from interface: Slice
      Get the template instantiations.
      Specified by:
      getTemplateInstantiations in interface Slice
      Returns:
      List of template instatiations
    • toString

      public String toString()
      Overrides:
      toString in class Object