com.h3c.sdn.adm.json

## Class AbstractMetricDescriptorCodec<T extends MetricDescriptor>

- java.lang.Object
- - com.h3c.util.json.AbstractJsonCodec<T>
  - - com.h3c.sdn.adm.json.AbstractMetricDescriptorCodec<T>

- Type Parameters:
    `T` - type of POJO for which a JSON codec is provided
  All Implemented Interfaces:
    JsonCodec<T>
  Direct Known Subclasses:
    CounterDescriptorCodec, GaugeDescriptorCodec, HistogramDescriptorCodec, MeterDescriptorCodec, RatioGaugeDescriptorCodec, RollingCounterDescriptorCodec, TimerDescriptorCodec

      public abstract class AbstractMetricDescriptorCodec<T extends MetricDescriptor>
      extends AbstractJsonCodec<T>

  A JSON codec capable of encoding and decoding `MetricDescriptor` objects.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `APP_ID`
    `protected static String` | `DESC`
    `protected static String` | `DESCRIPTION`
    `protected static String` | `ERROR`
    `protected static String` | `FAIL_COUNT`
    `protected static String` | `FAIL_NODE`
    `protected static String` | `JMX`
    `protected static String` | `NAME`
    `protected static String` | `PERSISTENCE`
    `protected static String` | `PRIMARY_TAG`
    `protected static String` | `PRIMING_VALUE`
    `static String` | `ROOT`
    `static String` | `ROOTS`
    `protected static String` | `SECONDARY_TAG`
    `protected static String` | `STATUS`
    `protected static String` | `SUCCESS_COUNT`
    `protected static String` | `SUCCESS_NODE`
    `protected static String` | `SUMMARY_INTERVAL`
    `protected static String` | `TYPE`

    - ### Fields inherited from class com.h3c.util.json.AbstractJsonCodec

      `log, mapper, NO_DECODING_SUP, root, roots`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMetricDescriptorCodec()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.fasterxml.jackson.databind.node.ObjectNode` | `encode(T md)` Encodes the given POJO to its JSON representation.
    `protected String` | `getName(com.fasterxml.jackson.databind.JsonNode metricNode)`
    `protected MetricDescriptor.Type` | `getType(com.fasterxml.jackson.databind.JsonNode metricNode)`
    `protected void` | `setCommonMetricDescriptor(com.fasterxml.jackson.databind.JsonNode metricNode, MetricDescriptor.MetricDescriptorBuilder<T> builder)`

    - ### Methods inherited from class com.h3c.util.json.AbstractJsonCodec

      `arrayNode, decode, decodeList, encode, encodeList, encodeList, fromEnums, isMissingContent, longVal, objectNode, read, root, roots, toEnums, write`

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

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

    - ### Methods inherited from interface com.h3c.util.json.JsonCodec

      `decode`

- - ### Field Detail

    - #### ROOT

          public static final String ROOT

      See Also:
        Constant Field Values

    - #### ROOTS

          public static final String ROOTS

      See Also:
        Constant Field Values

    - #### SUCCESS_NODE

          protected static final String SUCCESS_NODE

      See Also:
        Constant Field Values

    - #### FAIL_NODE

          protected static final String FAIL_NODE

      See Also:
        Constant Field Values

    - #### SUCCESS_COUNT

          protected static final String SUCCESS_COUNT

      See Also:
        Constant Field Values

    - #### FAIL_COUNT

          protected static final String FAIL_COUNT

      See Also:
        Constant Field Values

    - #### NAME

          protected static final String NAME

      See Also:
        Constant Field Values

    - #### DESCRIPTION

          protected static final String DESCRIPTION

      See Also:
        Constant Field Values

    - #### APP_ID

          protected static final String APP_ID

      See Also:
        Constant Field Values

    - #### TYPE

          protected static final String TYPE

      See Also:
        Constant Field Values

    - #### DESC

          protected static final String DESC

      See Also:
        Constant Field Values

    - #### PERSISTENCE

          protected static final String PERSISTENCE

      See Also:
        Constant Field Values

    - #### JMX

          protected static final String JMX

      See Also:
        Constant Field Values

    - #### SUMMARY_INTERVAL

          protected static final String SUMMARY_INTERVAL

      See Also:
        Constant Field Values

    - #### PRIMARY_TAG

          protected static final String PRIMARY_TAG

      See Also:
        Constant Field Values

    - #### SECONDARY_TAG

          protected static final String SECONDARY_TAG

      See Also:
        Constant Field Values

    - #### PRIMING_VALUE

          protected static final String PRIMING_VALUE

      See Also:
        Constant Field Values

    - #### STATUS

          protected static final String STATUS

      See Also:
        Constant Field Values

    - #### ERROR

          protected static final String ERROR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractMetricDescriptorCodec

          public AbstractMetricDescriptorCodec()

  - ### Method Detail

    - #### encode

          public com.fasterxml.jackson.databind.node.ObjectNode encode(T md)

      Description copied from interface: `JsonCodec`
      Encodes the given POJO to its JSON representation.
      Parameters:
        `md` - POJO to encode
      Returns:
        ObjectNode representation of POJO. This does not have a "top" root

    - #### getType

          protected MetricDescriptor.Type getType(com.fasterxml.jackson.databind.JsonNode metricNode)

    - #### setCommonMetricDescriptor

          protected void setCommonMetricDescriptor(com.fasterxml.jackson.databind.JsonNode metricNode,
                                       MetricDescriptor.MetricDescriptorBuilder<T> builder)

    - #### getName

          protected String getName(com.fasterxml.jackson.databind.JsonNode metricNode)

Copyright © 2014. All Rights Reserved.