com.h3c.sdn.adm.common.converter

## Class TeamConfigJsonConverter

- java.lang.Object
- - com.h3c.sdn.adm.common.converter.TeamConfigJsonConverter

-     public final class TeamConfigJsonConverter
      extends Object

  Utility class to convert `TeamConfig` to JSON format.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Pair<TeamConfig<SystemConfigReq>,Boolean>` | `decodeReq(String json)` Decodes a team configuration request from JSON format.
    `static TeamConfig<SystemConfigRsp>` | `decodeRsp(String json)` Decodes a team configuration response from JSON format.
    `static String` | `encodeReq(TeamConfig<SystemConfigReq> team)` Converts a team configuration request to a JSON format.
    `static String` | `encodeReq(TeamConfig<SystemConfigReq> team, boolean forwardRequest)` Converts a team configuration request to a JSON format.
    `static String` | `encodeRsp(TeamConfig<SystemConfigRsp> team)` Converts a team status response to a JSON format.
    `static String` | `encodeTeamActionStatus(List<TeamActionStatus<Boolean>> teamActionStatusList)` Converts `TeamActionStatus` to JSON format.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### encodeReq

          public static String encodeReq(TeamConfig<SystemConfigReq> team)

      Converts a team configuration request to a JSON format.
      Parameters:
        `team` - team configuration to convert.
      Returns:
        team configuration as JSON format.

    - #### encodeReq

          public static String encodeReq(TeamConfig<SystemConfigReq> team,
                         boolean forwardRequest)

      Converts a team configuration request to a JSON format.
      Parameters:
        `team` - team configuration to convert.
        `forwardRequest` - specifies whether the request must be propagated across all the members of the team.
      Returns:
        team configuration as JSON format.

    - #### encodeRsp

          public static String encodeRsp(TeamConfig<SystemConfigRsp> team)

      Converts a team status response to a JSON format.
      Parameters:
        `team` - team configuration to convert.
      Returns:
        team configuration as JSON format.

    - #### encodeTeamActionStatus

          public static String encodeTeamActionStatus(List<TeamActionStatus<Boolean>> teamActionStatusList)

      Converts `TeamActionStatus` to JSON format.
      Parameters:
        `teamActionStatusList` - `TeamActionStatus` list
      Returns:
        `TeamActionStatus` as JSON

    - #### decodeReq

          public static Pair<TeamConfig<SystemConfigReq>,Boolean> decodeReq(String json)
                                                                     throws com.fasterxml.jackson.core.JsonProcessingException,
                                                                            IOException

      Decodes a team configuration request from JSON format.
      Parameters:
        `json` - team configuration as JSON format.
      Returns:
        a tuple where the first elements represents the team configuration and the second specifies whether the request must be propagated across all the members of the team (forward request).
      Throws:
        `com.fasterxml.jackson.core.JsonProcessingException` - if errors processing the JSON input.
        `IOException` - if errors reading the JSON input.

    - #### decodeRsp

          public static TeamConfig<SystemConfigRsp> decodeRsp(String json)
                                                       throws com.fasterxml.jackson.core.JsonProcessingException,
                                                              IOException

      Decodes a team configuration response from JSON format.
      Parameters:
        `json` - team configuration as JSON format.
      Returns:
        a team configuration response.
      Throws:
        `com.fasterxml.jackson.core.JsonProcessingException` - if errors processing the JSON input.
        `IOException` - if errors reading the JSON input.

Copyright © 2014. All Rights Reserved.