Record Class Security
java.lang.Object
java.lang.Record
nl.datasteel.crudcraft.codegen.descriptor.field.part.Security
- Record Components:
defined
- whether aFieldSecurity
annotation is presentreadRoles
- roles allowed to read the fieldwriteRoles
- roles allowed to write the field
Field level security configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
defined()
Returns the value of thedefined
record component.boolean
Checks if the current Security object is equal to another object.String[]
Returns the roles allowed to read the field.String[]
Returns the roles allowed to write the field.boolean
Indicates whether any field security is configured.int
hashCode()
Computes the hash code for the Security object based on read and write roles.String[]
Safe, defensive accessor for read roles.toString()
Returns a string representation of the Security object.String[]
Safe, defensive accessor for write roles.
-
Constructor Details
-
Security
Immutable constructor for Security. Initializes read and write roles, ensuring they are not null.- Parameters:
readRoles
- roles allowed to read the fieldwriteRoles
- roles allowed to write the field
-
-
Method Details
-
readRoles
Safe, defensive accessor for read roles. -
getReadRoles
Returns the roles allowed to read the field. -
writeRoles
Safe, defensive accessor for write roles. -
getWriteRoles
Returns the roles allowed to write the field. -
hasFieldSecurity
public boolean hasFieldSecurity()Indicates whether any field security is configured. -
equals
Checks if the current Security object is equal to another object. Two Security objects are considered equal if they have the same read and write roles. -
hashCode
public int hashCode()Computes the hash code for the Security object based on read and write roles. -
toString
Returns a string representation of the Security object. -
defined
public boolean defined()Returns the value of thedefined
record component.- Returns:
- the value of the
defined
record component
-