Record Class PojoWalker.Options
java.lang.Object
java.lang.Record
org.apache.juneau.marshall.stream.PojoWalker.Options
- Record Components:
keepNullProperties- Whether bean fields with null values are emitted (true) or skipped (false).trimEmptyMaps- Whether bean / map fields whose value is an empty map are skipped.trimEmptyCollections- Whether bean / map fields whose value is an empty collection / array are skipped.sortMaps- Whether map / bean property iteration order is sorted by key.sortCollections- Whether collection element iteration order is sorted (a sorted copy is walked).trimStrings- Whether emitted scalar strings are trimmed.context- The live session'sMarshallingContextused for bean introspection (swaps / bean-filters / locale / timezone). May benull , in which caseMarshallingContext.DEFAULTis used.
- Enclosing class:
- PojoWalker
public static record PojoWalker.Options(boolean keepNullProperties, boolean trimEmptyMaps, boolean trimEmptyCollections, boolean sortMaps, boolean sortCollections, boolean trimStrings, MarshallingContext context)
extends Record
Databind-level settings honored by
PojoWalker.
Built by the format's writeTokens(...) factory from the calling
Serializer.Builder and
passed through to the walker. These are the same settings the POJO databind path
(Serializer.write(...)) consults; honoring them here means
writeTokens(out).object(o) produces the same shape as
serializer.write(o) for the same configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PojoWalker.OptionsDefault options: emit nulls, no trimming, no sorting, no bound context (falls back toMarshallingContext.DEFAULT). -
Constructor Summary
ConstructorsConstructorDescriptionOptions(boolean keepNullProperties, boolean trimEmptyMaps, boolean trimEmptyCollections, boolean sortMaps, boolean sortCollections, boolean trimStrings, MarshallingContext context) Creates an instance of aOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thekeepNullPropertiesrecord component.booleanReturns the value of thesortCollectionsrecord component.booleansortMaps()Returns the value of thesortMapsrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetrimEmptyCollectionsrecord component.booleanReturns the value of thetrimEmptyMapsrecord component.booleanReturns the value of thetrimStringsrecord component.
-
Field Details
-
DEFAULT
Default options: emit nulls, no trimming, no sorting, no bound context (falls back toMarshallingContext.DEFAULT). MirrorsSerializer.Builder's defaults.
-
-
Constructor Details
-
Options
public Options(boolean keepNullProperties, boolean trimEmptyMaps, boolean trimEmptyCollections, boolean sortMaps, boolean sortCollections, boolean trimStrings, MarshallingContext context) Creates an instance of aOptionsrecord class.- Parameters:
keepNullProperties- the value for thekeepNullPropertiesrecord componenttrimEmptyMaps- the value for thetrimEmptyMapsrecord componenttrimEmptyCollections- the value for thetrimEmptyCollectionsrecord componentsortMaps- the value for thesortMapsrecord componentsortCollections- the value for thesortCollectionsrecord componenttrimStrings- the value for thetrimStringsrecord componentcontext- the value for thecontextrecord 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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
keepNullProperties
Returns the value of thekeepNullPropertiesrecord component.- Returns:
- the value of the
keepNullPropertiesrecord component
-
trimEmptyMaps
Returns the value of thetrimEmptyMapsrecord component.- Returns:
- the value of the
trimEmptyMapsrecord component
-
trimEmptyCollections
Returns the value of thetrimEmptyCollectionsrecord component.- Returns:
- the value of the
trimEmptyCollectionsrecord component
-
sortMaps
Returns the value of thesortMapsrecord component.- Returns:
- the value of the
sortMapsrecord component
-
sortCollections
Returns the value of thesortCollectionsrecord component.- Returns:
- the value of the
sortCollectionsrecord component
-
trimStrings
Returns the value of thetrimStringsrecord component.- Returns:
- the value of the
trimStringsrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-