Closed ChrisRisner closed 8 years ago
Maybe I'm just confused... from what you're saying above (and in the code) they all return an Iterable. How is this inconsistent?
Sorry, I didn't realize that the code was removed from the comment. Here are the return types:
Iterable<CloudBlobContainer> listContainers
Iterable<CloudQueues> listQueues
Iterable<String> listTables
So the first two return objects with additional details (i.e. URI) where tables only returns the table name.
Ah, that's intentional. :) I realize it's not perfect, but here's why: for containers and queues there's additional metadata and properties that can be associated with the objects and which get returned by list. For tables, there's nothing -- no metadata, no properties. So, all that's actually ever returned is the table name. We could make a table object, but based on experience a lot of folks don't want the object and will just end up calling getName. Constructing the table object with the name is easy -- you just do client.getTableReference(tableName). So, we add the burden only for folks who actually want the object.
Summary: Container and queue need to full object to represent additional return values. Table does not.
Thanks for the explanation!
The CloudTableClient has a method named listTables which returns an Iterable where the CloudBlobClient's listContainers method returns an Iterable and the CloudQueueClient's listQueues method returns an Iterable.