Class MapBuilder


  • public class MapBuilder
    extends Object
    Builds a Java map based on the provided configuration and customization.
    • Method Detail

      • add

        public MapBuilder add​(String fieldName,
                              boolean include,
                              @Nullable
                              String value)
        Adds the string value to the provided map under the provided field name, if it's should be included.
      • add

        public MapBuilder add​(String fieldName,
                              boolean include,
                              @Nullable
                              Number number)
        Adds the number to the provided map under the provided field name if it's should be included.
      • add

        public MapBuilder add​(String fieldName,
                              boolean include,
                              @Nullable
                              Map<String,​?> mapValue)
        Adds the map to the provided map under the provided field name if it's should be included.
      • add

        public MapBuilder add​(String fieldName,
                              boolean include,
                              Supplier<String> supplier)
        Adds the string value to the provided map under the provided field name, if it should be included. The supplier is only invoked if the field is to be included.
      • addTimestamp

        public MapBuilder addTimestamp​(String fieldName,
                                       boolean include,
                                       long timestamp)
        Adds and optionally formats the timestamp to the provided map under the provided field name, if it's should be included.