Class SerializeOptions.Builder

java.lang.Object
org.jolokia.server.core.service.serializer.SerializeOptions.Builder
Enclosing class:
SerializeOptions

public static class SerializeOptions.Builder extends Object
Builder for constructing a convert options objects
  • Constructor Details

    • Builder

      public Builder()
      Default constructor using default hard limits
    • Builder

      public Builder(int pHardMaxDepth, int pHardMaxCollectionSize, int pHardMaxObjects)
      Constructor with hard limits. No value set later on this builder can be larger than these limits.
      Parameters:
      pHardMaxDepth - hard limit for maxDepth
      pHardMaxCollectionSize - hard limit for maxCollectionSize
      pHardMaxObjects - hard limit for maxObjects.
  • Method Details

    • maxDepth

      public SerializeOptions.Builder maxDepth(int pMaxDepth)
      Set the maximum depth for how deep serialization should go. The number cannot be set larger than the hard limit given in the constructor
      Parameters:
      pMaxDepth - maximal depth when traversing an object tree during serialization.
      Returns:
      this builder
    • maxCollectionSize

      public SerializeOptions.Builder maxCollectionSize(int pMaxCollectionSize)
      Set the maximal size of collections when serializing collections. The number cannot be set larger than the hard limit given in the constructor.
      Parameters:
      pMaxCollectionSize - maximum size of objects returned in a serialized collection
      Returns:
      this builder
    • maxObjects

      public SerializeOptions.Builder maxObjects(int pMaxObjects)
      Set the maximum number of objects to serialize. The number cannot be set larger than the hard limit given in the constructor.
      Parameters:
      pMaxObjects - maximum number of objects
      Returns:
      this builder
    • serializeLong

      public SerializeOptions.Builder serializeLong(String pSerializeLong)
      Set how to serialize long values. Can be either "number" or "string".
      Parameters:
      pSerializeLong - how to serialize long values
      Returns:
      this builder
    • faultHandler

      public SerializeOptions.Builder faultHandler(ValueFaultHandler pFaultHandler)
      Set the handler which determines what should be done when extracting of a value fails.
      Parameters:
      pFaultHandler - handler to use which can be either ValueFaultHandler.THROWING_VALUE_FAULT_HANDLER or ValueFaultHandler.THROWING_VALUE_FAULT_HANDLER. If argument is null, it is ignored
      Returns:
      this builder
    • useAttributeFilter

      public SerializeOptions.Builder useAttributeFilter(boolean pUseFilter)
      Whether an attribute filter should be used to ignore missing attributes when a path is applied
      Parameters:
      pUseFilter - if a filter should be used or not
      Returns:
      this builder
    • build

      public SerializeOptions build()
      Build the convert options and reset this builder
      Returns:
      the options created.