@param index integer indicating which object (contained in this object) to return @return the equipment object contained at this position.
(final int index)
| 5301 | * @return the equipment object contained at this position. |
| 5302 | */ |
| 5303 | public Equipment getContainedByIndex(final int index) |
| 5304 | { |
| 5305 | |
| 5306 | final List<Equipment> contents = new ArrayList<>(getContents()); |
| 5307 | |
| 5308 | if (!contents.isEmpty()) |
| 5309 | { |
| 5310 | if (index <= contents.size()) |
| 5311 | { |
| 5312 | return contents.get(index); |
| 5313 | } |
| 5314 | } |
| 5315 | |
| 5316 | return null; |
| 5317 | } |
| 5318 | |
| 5319 | /** |
| 5320 | * Get a piece of contained equipment |
no test coverage detected