code: @Override
      public UnitOfMeasure translate() {
          if (this.unitOfMeasure == null) {
              // In OCPP 1.5, WATT_HOUR is the default value.
              return UnitOfMeasure.WATT_HOUR;
          }
  
          UnitOfMeasure result;
  
          switch (this.unitOfMeasure) {
              case WH:
                  result = UnitOfMeasure.WATT_HOUR;
                  break;
              case K_WH:
                  result = UnitOfMeasure.KILOWATT_HOUR;
                  break;
              case VARH:
                  result = UnitOfMeasure.VAR_HOUR;
                  break;
              case KVARH:
                  result = UnitOfMeasure.KILOVAR_HOUR;
                  break;
              case W:
                  result = UnitOfMeasure.WATT;
                  break;
              case K_W:
                  result = UnitOfMeasure.KILOWATT;
                  break;
              case VAR:
                  result = UnitOfMeasure.VAR;
                  break;
              case KVAR:
                  result = UnitOfMeasure.KILOVAR;
                  break;
              case AMP:
                  result = UnitOfMeasure.AMPERES;
                  break;
              case VOLT:
                  result = UnitOfMeasure.VOLTAGE;
                  break;
              case CELSIUS:
                  return UnitOfMeasure.CELSIUS;
              default:
                  throw new AssertionError(String.format("Unknown value for unit of measure: '%s'", unitOfMeasure));
          }
  
          return result;
      }
docs: {@inheritDoc}