Enum Class CrudTemplate

java.lang.Object
java.lang.Enum<CrudTemplate>
nl.datasteel.crudcraft.annotations.CrudTemplate
All Implemented Interfaces:
Serializable, Comparable<CrudTemplate>, Constable, CrudEndpointPolicy

public enum CrudTemplate extends Enum<CrudTemplate> implements CrudEndpointPolicy
Enum representing various CRUD endpoint templates. Each template defines a specific set of CRUD operations that can be performed. These templates can be used to configure the behavior of CRUD endpoints in applications.
  • Enum Constant Details

    • FULL

      public static final CrudTemplate FULL
      Full API with every endpoint enabled.
    • READ_ONLY

      public static final CrudTemplate READ_ONLY
      Only read operations.
    • IMMUTABLE_WRITE

      public static final CrudTemplate IMMUTABLE_WRITE
      GET + POST operations, immutable once created.
    • PATCH_ONLY

      public static final CrudTemplate PATCH_ONLY
      Only PATCH for modifications, plus basic GET.
    • NO_DELETE

      public static final CrudTemplate NO_DELETE
      Everything except delete.
    • NO_BATCH

      public static final CrudTemplate NO_BATCH
      No bulk operations at all.
    • CREATE_ONLY

      public static final CrudTemplate CREATE_ONLY
      Only creation endpoints.
    • SEARCH_ONLY

      public static final CrudTemplate SEARCH_ONLY
      Only search style endpoints.
    • META_ONLY

      public static final CrudTemplate META_ONLY
      Only metadata operations.
    • LIGHT_PUBLIC

      public static final CrudTemplate LIGHT_PUBLIC
      Public lightweight endpoints.
    • SECURE_INTERNAL

      public static final CrudTemplate SECURE_INTERNAL
      All except bulk and export style endpoints.
    • VALIDATION_ONLY

      public static final CrudTemplate VALIDATION_ONLY
      Only validate endpoint.
  • Method Details

    • values

      public static CrudTemplate[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CrudTemplate valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • resolveEndpoints

      public Set<CrudEndpoint> resolveEndpoints()
      Returns the endpoints defined by this template.
      Specified by:
      resolveEndpoints in interface CrudEndpointPolicy
      Returns:
      a set of CrudEndpoint instances that this template includes
    • getEffectiveEndpoints

      public Set<CrudEndpoint> getEffectiveEndpoints(Set<CrudEndpoint> omitted, Set<CrudEndpoint> included)
      Return the complete set of endpoints that are effective when adding and removing other endpoints from the template.
      Parameters:
      omitted - the set of endpoints to be omitted from the template
      included - the set of endpoints to be included in the template
      Returns:
      a set of CrudEndpoint instances that are effective after applying the omitted and included endpoints