/aws-android-sdk-location/src/main/java/com/amazonaws/services/geo/model/transform/CalculateRouteCarModeOptionsJsonMarshaller.java

https://github.com/aws/aws-sdk-android · Java · 50 lines · 27 code · 6 blank · 17 comment · 6 complexity · a38504ae010b4d95d9b5241fe56a3c21 MD5 · raw file

  1. /*
  2. * Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License").
  5. * You may not use this file except in compliance with the License.
  6. * A copy of the License is located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. package com.amazonaws.services.geo.model.transform;
  16. import com.amazonaws.services.geo.model.*;
  17. import com.amazonaws.util.DateUtils;
  18. import com.amazonaws.util.json.AwsJsonWriter;
  19. /**
  20. * JSON marshaller for POJO CalculateRouteCarModeOptions
  21. */
  22. class CalculateRouteCarModeOptionsJsonMarshaller {
  23. public void marshall(CalculateRouteCarModeOptions calculateRouteCarModeOptions,
  24. AwsJsonWriter jsonWriter) throws Exception {
  25. jsonWriter.beginObject();
  26. if (calculateRouteCarModeOptions.getAvoidFerries() != null) {
  27. Boolean avoidFerries = calculateRouteCarModeOptions.getAvoidFerries();
  28. jsonWriter.name("AvoidFerries");
  29. jsonWriter.value(avoidFerries);
  30. }
  31. if (calculateRouteCarModeOptions.getAvoidTolls() != null) {
  32. Boolean avoidTolls = calculateRouteCarModeOptions.getAvoidTolls();
  33. jsonWriter.name("AvoidTolls");
  34. jsonWriter.value(avoidTolls);
  35. }
  36. jsonWriter.endObject();
  37. }
  38. private static CalculateRouteCarModeOptionsJsonMarshaller instance;
  39. public static CalculateRouteCarModeOptionsJsonMarshaller getInstance() {
  40. if (instance == null)
  41. instance = new CalculateRouteCarModeOptionsJsonMarshaller();
  42. return instance;
  43. }
  44. }