Record Class SvmDoccatModel.DeserializationLimits

java.lang.Object
java.lang.Record
opennlp.tools.ml.libsvm.doccat.SvmDoccatModel.DeserializationLimits
Record Components:
maxDepth - Maximum object-graph nesting depth. Must be > 0.
maxRefs - Maximum number of internal references the stream may create. Must be > 0.
maxArrayLength - Maximum length of any single array allocation requested by the stream. Must be > 0.
Enclosing class:
SvmDoccatModel

public static record SvmDoccatModel.DeserializationLimits(long maxDepth, long maxRefs, long maxArrayLength) extends Record
Resource limits applied to the ObjectInputFilter used by SvmDoccatModel.deserialize(InputStream, DeserializationLimits).

The limits bound graph traversal regardless of the class allow-list and provide defense-in-depth against pathological streams. The default values are generous enough for typical production models; raise them only if a legitimate model is rejected.

  • Field Details

    • DEFAULT

      public static final SvmDoccatModel.DeserializationLimits DEFAULT
      Default limits. Sized to allow typical production-scale models to round-trip while still bounding pathological streams.
  • Constructor Details

    • DeserializationLimits

      public DeserializationLimits(long maxDepth, long maxRefs, long maxArrayLength)
      Creates an instance of a DeserializationLimits record class.
      Parameters:
      maxDepth - the value for the maxDepth record component
      maxRefs - the value for the maxRefs record component
      maxArrayLength - the value for the maxArrayLength record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxDepth

      public long maxDepth()
      Returns the value of the maxDepth record component.
      Returns:
      the value of the maxDepth record component
    • maxRefs

      public long maxRefs()
      Returns the value of the maxRefs record component.
      Returns:
      the value of the maxRefs record component
    • maxArrayLength

      public long maxArrayLength()
      Returns the value of the maxArrayLength record component.
      Returns:
      the value of the maxArrayLength record component