Package opennlp.tools.ml.libsvm.doccat
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final SvmDoccatModel.DeserializationLimitsDefault limits. -
Constructor Summary
ConstructorsConstructorDescriptionDeserializationLimits(long maxDepth, long maxRefs, long maxArrayLength) Creates an instance of aDeserializationLimitsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of themaxArrayLengthrecord component.longmaxDepth()Returns the value of themaxDepthrecord component.longmaxRefs()Returns the value of themaxRefsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
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 aDeserializationLimitsrecord class.- Parameters:
maxDepth- the value for themaxDepthrecord componentmaxRefs- the value for themaxRefsrecord componentmaxArrayLength- the value for themaxArrayLengthrecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
maxDepth
public long maxDepth()Returns the value of themaxDepthrecord component.- Returns:
- the value of the
maxDepthrecord component
-
maxRefs
public long maxRefs()Returns the value of themaxRefsrecord component.- Returns:
- the value of the
maxRefsrecord component
-
maxArrayLength
public long maxArrayLength()Returns the value of themaxArrayLengthrecord component.- Returns:
- the value of the
maxArrayLengthrecord component
-