Record Class SandboxPolicy
java.lang.Object
java.lang.Record
de.luckymcdev.foundryengine.script.common.sandbox.SandboxPolicy
- Record Components:
enabled- whether sandbox restrictions applytimeoutSeconds- max seconds for script entry code, 0 = unlimited
Immutable snapshot of the sandbox settings, taken when a bundle is defined.
enabled == false turns off ALL sandboxing: no class loader filter, no AST checks,
no interrupt checks and no timeouts. It requires the config option AND the user's consent.
-
Constructor Summary
ConstructorsConstructorDescriptionSandboxPolicy(boolean enabled, long timeoutSeconds) Creates an instance of aSandboxPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SandboxPolicycurrent()booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanlongReturns the value of thetimeoutSecondsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SandboxPolicy
public SandboxPolicy(boolean enabled, long timeoutSeconds) Creates an instance of aSandboxPolicyrecord class.- Parameters:
enabled- the value for theenabledrecord componenttimeoutSeconds- the value for thetimeoutSecondsrecord component
-
-
Method Details
-
current
-
hasTimeout
public boolean hasTimeout() -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
enabled
-
timeoutSeconds
public long timeoutSeconds()Returns the value of thetimeoutSecondsrecord component.- Returns:
- the value of the
timeoutSecondsrecord component
-