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's MarshallingContext used for bean introspection (swaps / bean-filters / locale / timezone). May be null, in which case MarshallingContext.DEFAULT is 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 Details

  • Constructor Details

    • Options

      public Options(boolean keepNullProperties, boolean trimEmptyMaps, boolean trimEmptyCollections, boolean sortMaps, boolean sortCollections, boolean trimStrings, MarshallingContext context)
      Creates an instance of a Options record class.
      Parameters:
      keepNullProperties - the value for the keepNullProperties record component
      trimEmptyMaps - the value for the trimEmptyMaps record component
      trimEmptyCollections - the value for the trimEmptyCollections record component
      sortMaps - the value for the sortMaps record component
      sortCollections - the value for the sortCollections record component
      trimStrings - the value for the trimStrings record component
      context - the value for the context 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • keepNullProperties

      public boolean keepNullProperties()
      Returns the value of the keepNullProperties record component.
      Returns:
      the value of the keepNullProperties record component
    • trimEmptyMaps

      public boolean trimEmptyMaps()
      Returns the value of the trimEmptyMaps record component.
      Returns:
      the value of the trimEmptyMaps record component
    • trimEmptyCollections

      public boolean trimEmptyCollections()
      Returns the value of the trimEmptyCollections record component.
      Returns:
      the value of the trimEmptyCollections record component
    • sortMaps

      public boolean sortMaps()
      Returns the value of the sortMaps record component.
      Returns:
      the value of the sortMaps record component
    • sortCollections

      public boolean sortCollections()
      Returns the value of the sortCollections record component.
      Returns:
      the value of the sortCollections record component
    • trimStrings

      public boolean trimStrings()
      Returns the value of the trimStrings record component.
      Returns:
      the value of the trimStrings record component
    • context

      Returns the value of the context record component.
      Returns:
      the value of the context record component