Record Class ApprovalPolicy

java.lang.Object
java.lang.Record
com.shaft.pilot.ai.ApprovalPolicy
Record Components:
localInferenceAllowed - whether local endpoints may receive evidence
onPremInferenceAllowed - whether explicitly classified on-prem endpoints may receive evidence
remoteInferenceAllowed - whether remote endpoints may receive evidence
allowedEvidenceCategories - categories approved for this operation

public record ApprovalPolicy(boolean localInferenceAllowed, boolean onPremInferenceAllowed, boolean remoteInferenceAllowed, Set<EvidenceCategory> allowedEvidenceCategories) extends Record
Explicit consent for local or remote inference and evidence categories.
  • Constructor Details

    • ApprovalPolicy

      public ApprovalPolicy(boolean localInferenceAllowed, boolean remoteInferenceAllowed, Set<EvidenceCategory> allowedEvidenceCategories)
      Creates a backward-compatible local/remote policy.
    • ApprovalPolicy

      public ApprovalPolicy(boolean localInferenceAllowed, boolean onPremInferenceAllowed, boolean remoteInferenceAllowed, Set<EvidenceCategory> allowedEvidenceCategories)
      Creates an immutable approval policy.
  • Method Details

    • allows

      public boolean allows(ProcessingLocation location, Set<EvidenceCategory> requestedCategories)
      Returns whether a provider location and all requested evidence categories are approved.
      Parameters:
      location - provider processing location
      requestedCategories - evidence categories in the request
      Returns:
      true when the operation is explicitly approved
    • denyAll

      public static ApprovalPolicy denyAll()
      Returns a policy that denies all inference.
      Returns:
      deny-all policy
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • localInferenceAllowed

      public boolean localInferenceAllowed()
      Returns the value of the localInferenceAllowed record component.
      Returns:
      the value of the localInferenceAllowed record component
    • onPremInferenceAllowed

      public boolean onPremInferenceAllowed()
      Returns the value of the onPremInferenceAllowed record component.
      Returns:
      the value of the onPremInferenceAllowed record component
    • remoteInferenceAllowed

      public boolean remoteInferenceAllowed()
      Returns the value of the remoteInferenceAllowed record component.
      Returns:
      the value of the remoteInferenceAllowed record component
    • allowedEvidenceCategories

      public Set<EvidenceCategory> allowedEvidenceCategories()
      Returns the value of the allowedEvidenceCategories record component.
      Returns:
      the value of the allowedEvidenceCategories record component