Class TypeConverterUtils

java.lang.Object
com.sap.cds.adapter.odata.v4.utils.TypeConverterUtils

public class TypeConverterUtils extends Object
Utils to map Olingo types to CAP Java types and vice versa.
  • Method Details

    • convertToType

      public static Object convertToType(EdmType type, String value)
      Converts a String value to the correct Java value, based on the EdmType
      Parameters:
      type - the EdmType
      value - the string value
      Returns:
      the value in the correct Java type
    • getValueBasedOnTypeOfResultSet

      public static Object getValueBasedOnTypeOfResultSet(EdmType type, Object value)
      This method converts the result from db to correct Java Type required by Olingo serializers for types Guid, DateTime, Date and Time
      Parameters:
      type - EdmType
      value - Value
      Returns:
      java Object
    • getValueBasedOnTypeOfRequestPayload

      public static Object getValueBasedOnTypeOfRequestPayload(String typeName, Object value)
      This method converts input payload to correct Java Types for types Guid, DateTime, Date and Time The handlers will get the new java Date Time types because of this conversion
      Parameters:
      typeName - edmTypeName
      value - Value
      Returns:
      java Object