java.lang.Object
es.kukenan.smartfi.microservice.smartficore.util.CoreUtils

public class CoreUtils extends Object
smartfi-core utilities.
  • Field Details

  • Constructor Details

    • CoreUtils

      private CoreUtils()
      Hide constructor.
  • Method Details

    • getZoneDateTime

      public static ZonedDateTime getZoneDateTime(String str)
      Return the Timestamp corresponding to the given date string in smartfi-core DB format.
      Parameters:
      str - the given date string in smartfi-core DB format.
      Returns:
      the Date.
    • getLocalDate

      public static LocalDate getLocalDate(String str)
      Return the LocalDate corresponding to the given date string in smartfi-core DB format.
      Parameters:
      str - the given date string in smartfi-core DB format.
      Returns:
      the LocalDate.
    • formatDateParamForQuery

      public static String formatDateParamForQuery(String date)
      Format sql for date param fields.
      Parameters:
      date - as param
      Returns:
      the date formatted for sql sentence
    • getPastDateFromToday

      public static String getPastDateFromToday(int calendarField, int number)
      Get date from calendar fields for today.
      Parameters:
      calendarField - type of date (YEAR, DAYS, etc)
      number - number of calendar fields
      Returns:
      date in ISO 8601 format (yyyy-MM-dd)
    • checkShouldNotCoreEndpoints

      public static boolean checkShouldNotCoreEndpoints(String uriPath, String pattern)
      Check endpoints belongs to Core endpoints and filter depends uri.
      Parameters:
      uriPath - Uri with endpoint to evaluate.
      pattern - pattern for evaluate uri.
      Returns:
      boolean true belongs to Core endpoints, false not belongs to Core endpoints.