Class WetSuitRuleConverter

java.lang.Object
com.endurancetrio.data.event.model.converter.WetSuitRuleConverter
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<WetsuitRule,String>

public class WetSuitRuleConverter extends Object implements jakarta.persistence.AttributeConverter<WetsuitRule,String>
The WetSuitRuleConverter class is responsible for converting the WetsuitRule enum to its corresponding database column representation and vice versa.

This converter is used to persist the WetsuitRule enum as a string in the database. It converts the enum to its code when storing it in the database and converts the code back to the enum when retrieving it from the database.

  • Constructor Details

    • WetSuitRuleConverter

      public WetSuitRuleConverter()
  • Method Details

    • convertToDatabaseColumn

      public String convertToDatabaseColumn(WetsuitRule wetSuitRule)
      Specified by:
      convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<WetsuitRule,String>
    • convertToEntityAttribute

      public WetsuitRule convertToEntityAttribute(String code)
      Specified by:
      convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<WetsuitRule,String>