code: @Override
      public ReadingContext translate() {
          if (this.readingContext == null) {
              // In OCPP 1.5, PERIODIC_SAMPLE is the default value.
              return ReadingContext.PERIODIC_SAMPLE;
          }
  
          ReadingContext result;
  
          switch (this.readingContext) {
              case INTERRUPTION_BEGIN:
                  result = ReadingContext.BEGIN_INTERRUPTION;
                  break;
              case INTERRUPTION_END:
                  result = ReadingContext.END_INTERRUPTION;
                  break;
              case SAMPLE_CLOCK:
                  result = ReadingContext.CLOCK_SAMPLE;
                  break;
              case SAMPLE_PERIODIC:
                  result = ReadingContext.PERIODIC_SAMPLE;
                  break;
              case TRANSACTION_BEGIN:
                  result = ReadingContext.BEGIN_TRANSACTION;
                  break;
              case TRANSACTION_END:
                  result = ReadingContext.END_TRANSACTION;
                  break;
              default:
                  throw new AssertionError(String.format("Unknown value for ReadingContext: '%s'", readingContext));
          }
  
          return result;
      }
docs: {@inheritDoc}