Class DatadogConverter<T>

    • Constructor Detail

      • DatadogConverter

        @SafeVarargs
        protected DatadogConverter​(VersionedConverter<T> legacyConverter,
                                   @Nonnull
                                   VersionedConverter<T>... converters)
        Parameters:
        legacyConverter - Converter that is used to unmarshall legacy data written by older plugin versions
        converters - The list of versioned converters. Writing is always done with the most up-to-date converter (the one with the maximum version). Reading is done with the appropriate converter (the one that has version that matches the data version). If converter with the specified version does not exist, or data has no version attribute (written by an old version of the plugin), no deserialization is performed.
    • Method Detail

      • canConvert

        public boolean canConvert​(Class type)
        Specified by:
        canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
      • marshal

        public void marshal​(Object source,
                            com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                            com.thoughtworks.xstream.converters.MarshallingContext context)
        Specified by:
        marshal in interface com.thoughtworks.xstream.converters.Converter
      • unmarshal

        @Nullable
        public T unmarshal​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                           com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Specified by:
        unmarshal in interface com.thoughtworks.xstream.converters.Converter