@ -603,6 +603,31 @@ public class Update {
@@ -603,6 +603,31 @@ public class Update {
}
}
/ * *
* { @link Modifier } implementation used to propagate { @code $position } .
*
* @author Christoph Strobl
* @since 1 . 7
* /
private static class PositionModifier implements Modifier {
private final int position ;
public PositionModifier ( int position ) {
this . position = position ;
}
@Override
public String getKey ( ) {
return "$position" ;
}
@Override
public Object getValue ( ) {
return position ;
}
}
/ * *
* Implementation of { @link Modifier } representing { @code $slice } .
*
@ -636,31 +661,6 @@ public class Update {
@@ -636,31 +661,6 @@ public class Update {
}
}
/ * *
* { @link Modifier } implementation used to propagate { @code $position } .
*
* @author Christoph Strobl
* @since 1 . 7
* /
private static class PositionModifier implements Modifier {
private final int position ;
public PositionModifier ( int position ) {
this . position = position ;
}
@Override
public String getKey ( ) {
return "$position" ;
}
@Override
public Object getValue ( ) {
return position ;
}
}
/ * *
* Builder for creating { @code $push } modifiers
*
@ -681,7 +681,7 @@ public class Update {
@@ -681,7 +681,7 @@ public class Update {
* Propagates { @code $each } to { @code $push }
*
* @param values
* @return
* @return never { @literal null } .
* /
public Update each ( Object . . . values ) {
@ -698,7 +698,8 @@ public class Update {
@@ -698,7 +698,8 @@ public class Update {
* elements . < br / >
*
* @param count
* @return
* @return never { @literal null } .
* @since 1 . 10
* /
public PushOperatorBuilder slice ( int count ) {
@ -710,7 +711,7 @@ public class Update {
@@ -710,7 +711,7 @@ public class Update {
* Forces values to be added at the given { @literal position } .
*
* @param position needs to be greater than or equal to zero .
* @return
* @return never { @literal null } .
* @since 1 . 7
* /
public PushOperatorBuilder atPosition ( int position ) {
@ -728,7 +729,7 @@ public class Update {
@@ -728,7 +729,7 @@ public class Update {
* Forces values to be added at given { @literal position } .
*
* @param position can be { @literal null } which will be appended at the last position .
* @return
* @return never { @literal null } .
* @since 1 . 7
* /
public PushOperatorBuilder atPosition ( Position position ) {
@ -746,7 +747,7 @@ public class Update {
@@ -746,7 +747,7 @@ public class Update {
* Propagates { @link # value ( Object ) } to { @code $push }
*
* @param values
* @return
* @return never { @literal null } .
* /
public Update value ( Object value ) {
return Update . this . push ( key , value ) ;