Package dev.shamoo.runtime.core
Record Class RuntimePermissions
java.lang.Object
java.lang.Record
dev.shamoo.runtime.core.RuntimePermissions
public record RuntimePermissions(Set<String> builtins, Set<String> readablePaths, Set<String> writablePaths, boolean network, boolean workers, boolean childProcess, boolean nativeAddons)
extends Record
Canonical immutable runtime permissions derived from a manifest Node policy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuiltins()Returns the value of thebuiltinsrecord component.booleanReturns the value of thechildProcessrecord component.final booleanIndicates whether some other object is "equal to" this one.static RuntimePermissionsfrom(dev.shamoo.runtime.protocol.NodePolicy policy) Converts aliases such aspathandnode:pathto one canonical name.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thenativeAddonsrecord component.booleannetwork()Returns the value of thenetworkrecord component.booleanpermitsBuiltin(String name) Returns the value of thereadablePathsrecord component.final StringtoString()Returns a string representation of this record class.booleanworkers()Returns the value of theworkersrecord component.Returns the value of thewritablePathsrecord component.
-
Constructor Details
-
RuntimePermissions
public RuntimePermissions(Set<String> builtins, Set<String> readablePaths, Set<String> writablePaths, boolean network, boolean workers, boolean childProcess, boolean nativeAddons) Creates an instance of aRuntimePermissionsrecord class.- Parameters:
builtins- the value for thebuiltinsrecord componentreadablePaths- the value for thereadablePathsrecord componentwritablePaths- the value for thewritablePathsrecord componentnetwork- the value for thenetworkrecord componentworkers- the value for theworkersrecord componentchildProcess- the value for thechildProcessrecord componentnativeAddons- the value for thenativeAddonsrecord component
-
-
Method Details
-
from
Converts aliases such aspathandnode:pathto one canonical name. -
permitsBuiltin
-
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. -
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. -
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 '=='. -
builtins
Returns the value of thebuiltinsrecord component.- Returns:
- the value of the
builtinsrecord component
-
readablePaths
Returns the value of thereadablePathsrecord component.- Returns:
- the value of the
readablePathsrecord component
-
writablePaths
Returns the value of thewritablePathsrecord component.- Returns:
- the value of the
writablePathsrecord component
-
network
public boolean network()Returns the value of thenetworkrecord component.- Returns:
- the value of the
networkrecord component
-
workers
public boolean workers()Returns the value of theworkersrecord component.- Returns:
- the value of the
workersrecord component
-
childProcess
public boolean childProcess()Returns the value of thechildProcessrecord component.- Returns:
- the value of the
childProcessrecord component
-
nativeAddons
public boolean nativeAddons()Returns the value of thenativeAddonsrecord component.- Returns:
- the value of the
nativeAddonsrecord component
-