Record Class ApprovalPolicy
java.lang.Object
java.lang.Record
com.shaft.pilot.ai.ApprovalPolicy
- Record Components:
localInferenceAllowed- whether local endpoints may receive evidenceonPremInferenceAllowed- whether explicitly classified on-prem endpoints may receive evidenceremoteInferenceAllowed- whether remote endpoints may receive evidenceallowedEvidenceCategories- 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 Summary
ConstructorsConstructorDescriptionApprovalPolicy(boolean localInferenceAllowed, boolean onPremInferenceAllowed, boolean remoteInferenceAllowed, Set<EvidenceCategory> allowedEvidenceCategories) Creates an immutable approval policy.ApprovalPolicy(boolean localInferenceAllowed, boolean remoteInferenceAllowed, Set<EvidenceCategory> allowedEvidenceCategories) Creates a backward-compatible local/remote policy. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedEvidenceCategoriesrecord component.booleanallows(ProcessingLocation location, Set<EvidenceCategory> requestedCategories) Returns whether a provider location and all requested evidence categories are approved.static ApprovalPolicydenyAll()Returns a policy that denies all inference.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thelocalInferenceAllowedrecord component.booleanReturns the value of theonPremInferenceAllowedrecord component.booleanReturns the value of theremoteInferenceAllowedrecord component.final StringtoString()Returns a string representation of this record class.
-
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
Returns whether a provider location and all requested evidence categories are approved.- Parameters:
location- provider processing locationrequestedCategories- evidence categories in the request- Returns:
truewhen the operation is explicitly approved
-
denyAll
Returns a policy that denies all inference.- Returns:
- deny-all policy
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
localInferenceAllowed
public boolean localInferenceAllowed()Returns the value of thelocalInferenceAllowedrecord component.- Returns:
- the value of the
localInferenceAllowedrecord component
-
onPremInferenceAllowed
public boolean onPremInferenceAllowed()Returns the value of theonPremInferenceAllowedrecord component.- Returns:
- the value of the
onPremInferenceAllowedrecord component
-
remoteInferenceAllowed
public boolean remoteInferenceAllowed()Returns the value of theremoteInferenceAllowedrecord component.- Returns:
- the value of the
remoteInferenceAllowedrecord component
-
allowedEvidenceCategories
Returns the value of theallowedEvidenceCategoriesrecord component.- Returns:
- the value of the
allowedEvidenceCategoriesrecord component
-