Class RemovrCompositeSpec


  • public class RemovrCompositeSpec
    extends RemovrSpec
    Removr Spec that has children. In a removr spec, whenever the RHS is a Map, we build a RemovrCompositeSpec
    • Constructor Summary

      Constructors 
      Constructor Description
      RemovrCompositeSpec​(java.lang.String rawKey, java.util.Map<java.lang.String,​java.lang.Object> spec)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Integer> applyToList​(java.util.List<java.lang.Object> inputList)
      Build a list of indices to remove from the input list, using the pathElement from the Spec.
      java.util.List<java.lang.String> applyToMap​(java.util.Map<java.lang.String,​java.lang.Object> inputMap)
      Build a list of keys to remove from the input map, using the pathElement from the Spec.
      private void processChildren​(java.util.List<RemovrSpec> children, java.lang.Object subInput)
      Call our child nodes, build up the set of keys or indices to actually remove, and then remove them.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • allChildNodes

        private final java.util.List<RemovrSpec> allChildNodes
    • Constructor Detail

      • RemovrCompositeSpec

        public RemovrCompositeSpec​(java.lang.String rawKey,
                                   java.util.Map<java.lang.String,​java.lang.Object> spec)
    • Method Detail

      • applyToMap

        public java.util.List<java.lang.String> applyToMap​(java.util.Map<java.lang.String,​java.lang.Object> inputMap)
        Description copied from class: RemovrSpec
        Build a list of keys to remove from the input map, using the pathElement from the Spec.
        Specified by:
        applyToMap in class RemovrSpec
        Returns:
        the keys to remove, otherwise empty List.
      • applyToList

        public java.util.List<java.lang.Integer> applyToList​(java.util.List<java.lang.Object> inputList)
        Description copied from class: RemovrSpec
        Build a list of indices to remove from the input list, using the pathElement from the Spec.
        Specified by:
        applyToList in class RemovrSpec
        Returns:
        the indicies to remove, otherwise empty List.
      • processChildren

        private void processChildren​(java.util.List<RemovrSpec> children,
                                     java.lang.Object subInput)
        Call our child nodes, build up the set of keys or indices to actually remove, and then remove them.