Skip to content

Commit 05af2bc

Browse files
committed
javadocs, javadoc, javadoc...28 to go
1 parent c08267d commit 05af2bc

File tree

13 files changed

+92
-5
lines changed

13 files changed

+92
-5
lines changed

astra-db-java/src/main/java/com/datastax/astra/client/DataAPIClients.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ public static DataAPIClient clientHCD() {
183183
* </ul>
184184
* This setup allows developers to focus on application logic rather than database configuration or connectivity.
185185
*
186+
* @param username The username for authenticating with the Data API. This username should have the necessary
187+
* @param password The password for authenticating with the Data API. This password should be kept secure and
186188
* @return A {@link Database} client configured for use with a local Stargate instance, including a default
187189
* keyspace for immediate interaction. This client abstracts database connectivity and administrative tasks,
188190
* streamlining development workflows.

astra-db-java/src/main/java/com/datastax/astra/client/core/options/DataAPIClientOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ public static SerdesOptions getSerdesOptions() {
278278
/**
279279
* Register an observer with its className.
280280
*
281+
* @param name observer name
281282
* @param observer command observer
282283
* @return instance of the command options
283284
*/

astra-db-java/src/main/java/com/datastax/astra/client/databases/Database.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ public Collection<Document> getCollection(String collectionName) {
615615
*
616616
* @param collectionName The name of the collection to retrieve.
617617
* @param documentClass The class type of the documents stored in the collection.
618+
* @param <T> The type of the documents stored in the collection.
618619
* @return A {@link Collection} object representing the specified collection, configured with the provided options.
619620
*/
620621
public <T> Collection<T> getCollection(String collectionName, Class<T> documentClass) {

astra-db-java/src/main/java/com/datastax/astra/client/tables/commands/options/DropTableIndexOptions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import static com.datastax.astra.client.core.commands.CommandType.TABLE_ADMIN;
2929
import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;
3030

31+
/**
32+
* Options for dropping an index on a table.
33+
*/
3134
@Setter
3235
@Accessors(fluent = true, chain = true)
3336
public class DropTableIndexOptions extends BaseOptions<DropTableIndexOptions> {

astra-db-java/src/main/java/com/datastax/astra/client/tables/commands/options/DropTableOptions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import static com.datastax.astra.client.core.commands.CommandType.TABLE_ADMIN;
2929
import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;
3030

31+
/**
32+
* Options for dropping a table.
33+
*/
3134
@Setter
3235
@Accessors(fluent = true, chain = true)
3336
public class DropTableOptions extends BaseOptions<DropTableOptions> {

astra-db-java/src/main/java/com/datastax/astra/client/tables/definition/columns/ColumnTypeMapper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public class ColumnTypeMapper {
6565
*/
6666
private static final Map<Class<?>, ColumnTypes> typeMapping = new HashMap<>();
6767

68+
/**
69+
* Static initializer block that populates the type mapping.
70+
*/
6871
static {
6972
// Primitive and wrapper types
7073
typeMapping.put(Integer.class, ColumnTypes.INT);
@@ -104,6 +107,11 @@ public class ColumnTypeMapper {
104107
typeMapping.put(Object.class, ColumnTypes.UNSUPPORTED);
105108
}
106109

110+
/**
111+
* Private constructor to prevent instantiation.
112+
*/
113+
private ColumnTypeMapper() {}
114+
107115
/**
108116
* Retrieves the Cassandra column type corresponding to the given Java class.
109117
* If the type is not explicitly mapped, {@code ColumnTypes.UNSUPPORTED} is returned.

astra-db-java/src/main/java/com/datastax/astra/client/tables/mapping/EntityTable.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
/**
3636
* Table Name, if not provided the class name will be used
37+
* @return the table name
3738
*/
3839
String value() default "";
3940
}

astra-db-java/src/main/java/com/datastax/astra/internal/api/DataAPIDocumentResponse.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,46 @@
2828
import java.io.Serializable;
2929
import java.util.List;
3030

31-
@Getter @Setter
31+
/**
32+
* Represents the response of a Data API operation involving documents.
33+
* <p>
34+
* This class provides a structured representation of a document response,
35+
* including its unique identifier(s) and status. The class is serializable
36+
* and integrates with JSON serialization frameworks like Jackson.
37+
* </p>
38+
*/
39+
@Getter
40+
@Setter
3241
public class DataAPIDocumentResponse implements Serializable {
3342

43+
/**
44+
* A list of objects representing the unique identifier(s) of the document.
45+
* <p>
46+
* This field is annotated with {@link JsonProperty} to map it to the {@code "_id"}
47+
* key in JSON.
48+
* </p>
49+
*/
3450
@JsonProperty("_id")
3551
private List<Object> id;
3652

53+
/**
54+
* The status of the document operation, such as "SUCCESS" or "FAILED".
55+
*/
3756
private String status;
3857

58+
/**
59+
* Default constructor for serialization frameworks.
60+
*/
61+
public DataAPIDocumentResponse() {}
62+
63+
/**
64+
* Converts the {@code DataAPIDocumentResponse} object into a string representation.
65+
* This implementation uses {@link RowSerializer#marshall(Object)} for serialization.
66+
*
67+
* @return a string representation of this object
68+
*/
3969
@Override
4070
public String toString() {
4171
return new RowSerializer().marshall(this);
4272
}
43-
}
73+
}

astra-db-java/src/main/java/com/datastax/astra/internal/api/DataAPIResponse.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
* such as status information, error details, and data returned by 'find' operations. It provides flexibility to handle
4444
* various types of responses within a unified framework.
4545
*/
46-
@Getter
47-
@Setter
46+
@Getter @Setter
4847
public class DataAPIResponse implements Serializable {
4948

5049
/**
@@ -129,6 +128,14 @@ public <T> Map<String, T> getStatusKeyAsMap(@NonNull String key, Class<T> target
129128
.constructMapType(Map.class, String.class, targetClass));
130129
}
131130

131+
/**
132+
* Retrieves a single object from the 'status' map based on the provided key, casting it to the specified class.
133+
* This method is suitable for cases where the status information contains a single object under a specific key.
134+
*
135+
* @param targetClass The class to which the object should be cast.
136+
* @param <T> The type of the object to be returned.
137+
* @return The object associated with the specified key, cast to the specified class; {@code null} if the key does not exist.
138+
*/
132139
public <T> T getStatus(Class<T> targetClass) {
133140
return serializer.getMapper().convertValue(status, targetClass);
134141
}

astra-db-java/src/main/java/com/datastax/astra/internal/api/DataAPIStatus.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
import java.util.List;
3737
import java.util.Map;
3838

39+
/**
40+
* Status of the Data API.
41+
*/
3942
@Getter @Setter
4043
public class DataAPIStatus {
4144

@@ -84,6 +87,12 @@ public class DataAPIStatus {
8487
@JsonIgnore
8588
private DataAPISerializer serializer;
8689

90+
/**
91+
* Default constructor.
92+
*/
93+
public DataAPIStatus() {
94+
}
95+
8796
/**
8897
* Access the insertedIds mapping.
8998
*

0 commit comments

Comments
 (0)