Package model

Interface MeasurementOption

All Known Implementing Classes:
DnsOptions, HttpOptions, MtrOptions, PingOptions, TracerouteOptions

public interface MeasurementOption
Represents a measurement option used in API requests, providing methods to convert the option into JSON format.

Classes implementing this interface must define how their data is serialized to both string-based and byte-based JSON formats.

Usage Example:


 DnsOptions dno = new DnsOptionsBuilder().withQuery(DnsQueryType.MX).build();
 String jsonString = dnsOptions.toJson();
 byte[] jsonBytes = dnsOptions.toJsonBytes();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Converts the measurement option to its JSON string representation.
    byte[]
    Converts the measurement option to a JSON byte array.
  • Method Details

    • toJson

      String toJson()
      Converts the measurement option to its JSON string representation.
      Returns:
      a JSON string representing the measurement option.
    • toJsonBytes

      byte[] toJsonBytes()
      Converts the measurement option to a JSON byte array.
      Returns:
      a byte array containing the JSON representation of the measurement option.