Record Class ModelSecurity
java.lang.Object
java.lang.Record
nl.datasteel.crudcraft.codegen.descriptor.model.part.ModelSecurity
- Record Components:
secure
- whether the model endpoints require securitysecurityPolicy
- the class handling security policiesrowSecurityHandlers
- optional row-level security handler class names
public record ModelSecurity(boolean secure, Class<? extends CrudSecurityPolicy> securityPolicy, List<String> rowSecurityHandlers)
extends Record
Security-related configuration for a model.
-
Constructor Summary
ConstructorsConstructorDescriptionModelSecurity
(boolean secure, Class<? extends CrudSecurityPolicy> securityPolicy, List<String> rowSecurityHandlers) Creates an instance of aModelSecurity
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the class names that handle row-level security for this model, if any.Class
<? extends CrudSecurityPolicy> Returns the class that handles security policies for this model.final int
hashCode()
Returns a hash code value for this object.boolean
isSecure()
Returns true if the model endpoints require security.Returns the value of therowSecurityHandlers
record component.boolean
secure()
Returns the value of thesecure
record component.Class
<? extends CrudSecurityPolicy> Returns the value of thesecurityPolicy
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ModelSecurity
public ModelSecurity(boolean secure, Class<? extends CrudSecurityPolicy> securityPolicy, List<String> rowSecurityHandlers) Creates an instance of aModelSecurity
record class.- Parameters:
secure
- the value for thesecure
record componentsecurityPolicy
- the value for thesecurityPolicy
record componentrowSecurityHandlers
- the value for therowSecurityHandlers
record component
-
-
Method Details
-
isSecure
public boolean isSecure()Returns true if the model endpoints require security.- Returns:
- true if secure
-
getSecurityPolicy
Returns the class that handles security policies for this model.- Returns:
- the security policy class
-
getRowSecurityHandlers
Returns the class names that handle row-level security for this model, if any.- Returns:
- list of fully qualified row security handler class names
-
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 '=='. -
secure
public boolean secure()Returns the value of thesecure
record component.- Returns:
- the value of the
secure
record component
-
securityPolicy
Returns the value of thesecurityPolicy
record component.- Returns:
- the value of the
securityPolicy
record component
-
rowSecurityHandlers
Returns the value of therowSecurityHandlers
record component.- Returns:
- the value of the
rowSecurityHandlers
record component
-