java.lang.Object
org.dspace.app.rest.repository.patch.operation.resourcePolicy.ResourcePolicyUtils

@Component public class ResourcePolicyUtils extends Object
Util class for shared methods between the ResourcePolicy patches.
Author:
Maria Verdonck (Atmire) on 14/02/2020, Andrea Bollini (andrea.bollini at 4science.it)
  • Field Details

  • Constructor Details

    • ResourcePolicyUtils

      public ResourcePolicyUtils()
  • Method Details

    • checkResourcePolicyForExistingStartDateValue

      public void checkResourcePolicyForExistingStartDateValue(ResourcePolicy resource, Operation operation)
      Throws PatchBadRequestException for missing value in the /startDate path.
      Parameters:
      resource - the resource to update
      operation - the operation to apply
    • checkResourcePolicyForExistingEndDateValue

      public void checkResourcePolicyForExistingEndDateValue(ResourcePolicy resource, Operation operation)
      Throws PatchBadRequestException for missing value in the /endDate path.
      Parameters:
      resource - the resource to update
      operation - the operation to apply
    • checkResourcePolicyForExistingNameValue

      public void checkResourcePolicyForExistingNameValue(ResourcePolicy resource, Operation operation)
      Throws PatchBadRequestException for missing value in the /startDate path.
      Parameters:
      resource - the resource to update
      operation - the operation to apply
    • checkResourcePolicyForExistingDescriptionValue

      public void checkResourcePolicyForExistingDescriptionValue(ResourcePolicy resource, Operation operation)
      Throws PatchBadRequestException for missing value in the /description path.
      Parameters:
      resource - the resource to update
      operation - the operation to apply
    • checkResourcePolicyForConsistentStartDateValue

      public void checkResourcePolicyForConsistentStartDateValue(ResourcePolicy resource, Operation operation)
      Throws PatchBadRequestException if the value for startDate is not consistent with the endDate value, if present (greater than).
      Parameters:
      resource - the resource to update
      operation - the operation to apply
    • checkResourcePolicyForConsistentEndDateValue

      public void checkResourcePolicyForConsistentEndDateValue(ResourcePolicy resource, Operation operation)
      Throws PatchBadRequestException if the value for endDate is not consistent with the startDate value, if present (smaller than).
      Parameters:
      resource - the resource to update
      operation - the operation to apply