Class SaveOptions


  • public class SaveOptions
    extends java.lang.Object
    Immutable SaveOptions can be used to read and write options into the map that is passed into Resource.save(Map). Clients should create options by means of SaveOptions.newBuilder() and subsequent calls to configure the result or SaveOptions.defaultOptions(). The options map may be populated via toOptionsMap() or addTo(Map). Clients are free to extend this interface and the respective builder implementation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SaveOptions.Builder
      Allows to create new SaveOptions in a readable manner.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String KEY  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SaveOptions​(boolean formatting, boolean validating)  
    • Field Detail

      • KEY

        protected static final java.lang.String KEY
    • Constructor Detail

      • SaveOptions

        protected SaveOptions​(boolean formatting,
                              boolean validating)
    • Method Detail

      • getOptions

        public static SaveOptions getOptions​(java.util.Map<?,​?> saveOptions)
        Transparently handles the deprecated options that could be passed as map-entries to Resource.save(Map) and converts them to semantically equal SaveOptions.
        Parameters:
        saveOptions - the options-map or null if none.
        Returns:
        the options to use. Will never return null.
      • addTo

        public void addTo​(java.util.Map<java.lang.Object,​java.lang.Object> saveOptions)
        Configures the save options into the given map. The method modifies the given parameter so it may not be an ImmutableMap or a read-only Map.
        Parameters:
        saveOptions - the options to be modified. May not be null.
      • toOptionsMap

        public java.util.Map<java.lang.Object,​java.lang.Object> toOptionsMap()
      • isFormatting

        public boolean isFormatting()
      • isValidating

        @Deprecated
        public boolean isValidating()
        Deprecated.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • defaultOptions

        public static SaveOptions defaultOptions()
        This is equal to builder().getOptions().