Class Utilities

java.lang.Object
io.sapl.springdatacommon.utils.Utilities

public class Utilities extends Object
  • Field Details

  • Constructor Details

    • Utilities

      public Utilities()
  • Method Details

    • isMethodNameValid

      public boolean isMethodNameValid(String methodName)
    • isSpringDataDefaultMethod

      public boolean isSpringDataDefaultMethod(String methodName)
    • isFlux

      public static boolean isFlux(Class<?> clazz)
    • isMono

      public static boolean isMono(Class<?> clazz)
    • isListOrCollection

      public static boolean isListOrCollection(Class<?> clazz)
    • isString

      public static boolean isString(Object object)
    • isString

      public static boolean isString(Class<?> clazz)
    • readTree

      public static com.fasterxml.jackson.databind.JsonNode readTree(String tree)
    • convertReturnTypeIfNecessary

      public static <T> Object convertReturnTypeIfNecessary(reactor.core.publisher.Flux<T> databaseObjects, Class<?> returnClassOfMethod)
      To avoid duplicate code and for simplicity, fluxes were used in all EnforcementPoints, even if the database method expects a mono. Therefore, at this point it must be checked here what the return type is and transformed accordingly. In addition, the case that a non-reactive type, such as a list or collection, is expected is also covered.
      Parameters:
      databaseObjects - are the already manipulated objects, which are queried with the manipulated query.
      returnClassOfMethod - is the type which the database method expects as return type.
      Returns:
      the manipulated objects transformed to the correct type accordingly.