|
16 | 16 |
|
17 | 17 | package com.mongodb; |
18 | 18 |
|
| 19 | +@SuppressWarnings("deprecation") |
19 | 20 | public class AggregationOutput { |
20 | 21 |
|
21 | 22 | /** |
22 | 23 | * returns an iterator to the results of the aggregation |
23 | | - * @return |
| 24 | + * @return the results of the aggregation |
24 | 25 | */ |
25 | 26 | public Iterable<DBObject> results() { |
26 | 27 | return _resultSet; |
27 | 28 | } |
28 | 29 |
|
29 | 30 | /** |
30 | 31 | * returns the command result of the aggregation |
31 | | - * @return |
| 32 | + * @return the command result |
| 33 | + * |
| 34 | + * @deprecated there is no replacement for this method |
32 | 35 | */ |
| 36 | + @Deprecated |
33 | 37 | public CommandResult getCommandResult(){ |
34 | 38 | return _commandResult; |
35 | 39 | } |
36 | 40 |
|
37 | 41 | /** |
38 | 42 | * returns the original aggregation command |
39 | | - * @return |
| 43 | + * @return the command |
| 44 | + * |
| 45 | + * @deprecated there is no replacement for this method |
40 | 46 | */ |
| 47 | + @Deprecated |
41 | 48 | public DBObject getCommand() { |
42 | 49 | return _cmd; |
43 | 50 | } |
44 | 51 |
|
45 | 52 | /** |
46 | 53 | * returns the address of the server used to execute the aggregation |
47 | | - * @return |
| 54 | + * @return the server which executed the aggregation |
| 55 | + * |
| 56 | + * @deprecated there is no replacement for this method |
48 | 57 | */ |
| 58 | + @Deprecated |
49 | 59 | public ServerAddress getServerUsed() { |
50 | 60 | return _commandResult.getServerUsed(); |
51 | 61 | } |
52 | 62 |
|
53 | 63 | /** |
54 | | - * string representation of the aggregation command |
| 64 | + * Constructs a new instance |
| 65 | + * |
| 66 | + * @param command the aggregation command |
| 67 | + * @param commandResult the aggregation command result |
| 68 | + * |
| 69 | + * @deprecated there is no replacement for this constructor |
55 | 70 | */ |
56 | | - public String toString(){ |
57 | | - return _commandResult.toString(); |
58 | | - } |
59 | | - |
60 | 71 | @SuppressWarnings("unchecked") |
61 | | - public AggregationOutput(DBObject cmd, CommandResult raw) { |
62 | | - _commandResult = raw; |
63 | | - _cmd = cmd; |
| 72 | + @Deprecated |
| 73 | + public AggregationOutput(DBObject command, CommandResult commandResult) { |
| 74 | + _commandResult = commandResult; |
| 75 | + _cmd = command; |
64 | 76 |
|
65 | | - if(raw.containsField("result")) |
66 | | - _resultSet = (Iterable<DBObject>) raw.get( "result" ); |
| 77 | + if(commandResult.containsField("result")) |
| 78 | + _resultSet = (Iterable<DBObject>) commandResult.get( "result" ); |
67 | 79 | else |
68 | 80 | throw new IllegalArgumentException("result undefined"); |
69 | 81 | } |
|
0 commit comments