Class PushOptions

    • Constructor Summary

      Constructors 
      Constructor Description
      PushOptions​()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.Integer getPosition​()
      Gets the position at which to add the pushed values in the array.
      java.lang.Integer getSlice​()
      Gets the slice value, which is the limit on the number of array elements allowed.
      java.lang.Integer getSort​()
      Gets the sort direction for sorting array elements that are not documents.
      Bson getSortDocument​()
      Gets the sort direction for sorting array elements that are documents.
      int hashCode​()  
      PushOptions position​(java.lang.Integer position)
      Sets the position at which to add the pushed values in the array.
      PushOptions slice​(java.lang.Integer slice)
      Sets the limit on the number of array elements allowed.
      PushOptions sort​(java.lang.Integer sort)
      Sets the sort direction for sorting array elements that are not documents.
      PushOptions sortDocument​(Bson sortDocument)
      Sets the sort direction for sorting array elements that are documents.
      java.lang.String toString​()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PushOptions

        public PushOptions​()
    • Method Detail

      • getPosition

        @Nullable
        public java.lang.Integer getPosition​()
        Gets the position at which to add the pushed values in the array.
        Returns:
        the position, which may be null
        MongoDB documentation
        $position
      • position

        public PushOptions position​(@Nullable
                                    java.lang.Integer position)
        Sets the position at which to add the pushed values in the array.
        Parameters:
        position - the position
        Returns:
        this
        MongoDB documentation
        $position
      • getSlice

        @Nullable
        public java.lang.Integer getSlice​()
        Gets the slice value, which is the limit on the number of array elements allowed.
        Returns:
        the slice value representing the limit on the number of array elements allowed
        MongoDB documentation
        $slice
      • slice

        public PushOptions slice​(@Nullable
                                 java.lang.Integer slice)
        Sets the limit on the number of array elements allowed.
        Parameters:
        slice - the limit
        Returns:
        this
        MongoDB documentation
        $slice
      • getSortDocument

        @Nullable
        public Bson getSortDocument​()
        Gets the sort direction for sorting array elements that are documents.
        Returns:
        the sort document
        MongoDB documentation
        $sort
      • sortDocument

        public PushOptions sortDocument​(@Nullable
                                        Bson sortDocument)
        Sets the sort direction for sorting array elements that are documents.
        Parameters:
        sortDocument - the sort document
        Returns:
        this
        Throws:
        java.lang.IllegalStateException - if sort property is already set
        MongoDB documentation
        $sort
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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