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 security
securityPolicy - the class handling security policies
rowSecurityHandlers - 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 Details

    • ModelSecurity

      public ModelSecurity(boolean secure, Class<? extends CrudSecurityPolicy> securityPolicy, List<String> rowSecurityHandlers)
      Creates an instance of a ModelSecurity record class.
      Parameters:
      secure - the value for the secure record component
      securityPolicy - the value for the securityPolicy record component
      rowSecurityHandlers - the value for the rowSecurityHandlers record component
  • Method Details

    • isSecure

      public boolean isSecure()
      Returns true if the model endpoints require security.
      Returns:
      true if secure
    • getSecurityPolicy

      public Class<? extends CrudSecurityPolicy> getSecurityPolicy()
      Returns the class that handles security policies for this model.
      Returns:
      the security policy class
    • getRowSecurityHandlers

      public List<String> 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

      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 '=='.
      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.
    • secure

      public boolean secure()
      Returns the value of the secure record component.
      Returns:
      the value of the secure record component
    • securityPolicy

      public Class<? extends CrudSecurityPolicy> securityPolicy()
      Returns the value of the securityPolicy record component.
      Returns:
      the value of the securityPolicy record component
    • rowSecurityHandlers

      public List<String> rowSecurityHandlers()
      Returns the value of the rowSecurityHandlers record component.
      Returns:
      the value of the rowSecurityHandlers record component