Skip to content

Commit e118718

Browse files
author
Alexandre Dutra
committed
Minor enhancements to the javadocs of "driver-extras' module.
1 parent 94befb4 commit e118718

19 files changed

Lines changed: 140 additions & 179 deletions

driver-extras/src/main/java/com/datastax/driver/extras/codecs/MappingCodec.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@
2424
import com.datastax.driver.core.exceptions.InvalidTypeException;
2525

2626
/**
27-
* An abstract TypeCodec that maps a Java Pojo to another Java object
27+
* An abstract {@link TypeCodec} that maps a Java Pojo to another Java object
2828
* that can in turn be serialized into a CQL type.
2929
* This can serve as a base for libraries dealing with Pojo mappings.
3030
* <p>
3131
* This codec can be seen as a convenience base class for libraries
3232
* dealing with Pojo-to-Pojo mappings, but it comes
3333
* with a performance penalty: each Java object is serialized
34-
* in two steps: first to an intermediary object, and then to a ByteBuffer,
34+
* in two steps: first to an intermediate object, and then to a {@link ByteBuffer},
3535
* which means that each serialization actually incurs in two potentially
3636
* expensive operations being carried.
3737
* <p>
3838
* If such operations are really expensive, and your mapping library is capable
39-
* of serializing objects directly to ByteBuffers,
39+
* of serializing objects directly to {@link ByteBuffer}s,
4040
* consider writing your own codec instead of using this one.
4141
*
4242
* @param <O> The "outer" (user-facing) Java type

driver-extras/src/main/java/com/datastax/driver/extras/codecs/ParsingCodec.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424
import com.datastax.driver.core.exceptions.InvalidTypeException;
2525

2626
/**
27-
* An abstract TypeCodec that stores JAVA objects as serialized strings.
27+
* An abstract {@link TypeCodec} that stores JAVA objects as serialized strings.
2828
* This can serve as a base for codecs dealing with XML or JSON formats.
2929
* <p>
3030
* This codec can be seen as a convenience base class to help
3131
* implementing Java-to-XML or Java-to-JSON mappings, but it comes
3232
* with a performance penalty: each Java object is serialized
33-
* in two steps: first to a String, and then to a ByteBuffer,
33+
* in two steps: first to a String, and then to a {@link ByteBuffer},
3434
* which means that each serialization actually incurs in two potentially
3535
* expensive operations being carried.
3636
* <p>
3737
* If you are using an XML or JSON library that supports writing Java objects
38-
* directly to ByteBuffers, consider writing your own codec instead of
38+
* directly to {@link ByteBuffer}s, consider writing your own codec instead of
3939
* using this one.
4040
*
4141
* @param <T> The Java type this codec serializes from and deserializes to.

driver-extras/src/main/java/com/datastax/driver/extras/codecs/arrays/package-info.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,5 @@
1818
* This package contains a collection of convenience
1919
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
2020
* serializing between CQL lists and Java arrays.
21-
* <p>
22-
* The codecs in this package provide the following mappings:
23-
*
24-
* <table summary="Supported Mappings">
25-
* <tr>
26-
* <th>Codec</th>
27-
* <th>CQL type</th>
28-
* <th>Java type</th>
29-
* </tr>
30-
* <tr>
31-
* <td>{@link com.datastax.driver.extras.codecs.arrays.ObjectArrayCodec}</td>
32-
* <td>{@code list<?>}</td>
33-
* <td>{@code T[]}</td>
34-
* </tr>
35-
* <tr>
36-
* <td>{@link com.datastax.driver.extras.codecs.arrays.IntArrayCodec}</td>
37-
* <td>{@code list<int>}</td>
38-
* <td>{@code int[]}</td>
39-
* </tr>
40-
* <tr>
41-
* <td>{@link com.datastax.driver.extras.codecs.arrays.LongArrayCodec}</td>
42-
* <td>{@code list<long>}</td>
43-
* <td>{@code long[]}</td>
44-
* </tr>
45-
* <tr>
46-
* <td>{@link com.datastax.driver.extras.codecs.arrays.FloatArrayCodec}</td>
47-
* <td>{@code list<float>}</td>
48-
* <td>{@code float[]}</td>
49-
* </tr>
50-
* <tr>
51-
* <td>{@link com.datastax.driver.extras.codecs.arrays.DoubleArrayCodec}</td>
52-
* <td>{@code list<double>}</td>
53-
* <td>{@code double[]}</td>
54-
* </tr>
55-
* </table>
5621
*/
5722
package com.datastax.driver.extras.codecs.arrays;

driver-extras/src/main/java/com/datastax/driver/extras/codecs/date/package-info.java

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,7 @@
1616

1717
/**
1818
* This package contains a collection of convenience
19-
* {@link com.datastax.driver.core.TypeCodec} instances useful for
19+
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
2020
* serializing between CQL temporal types and Java primitive types.
21-
* <p>
22-
* The codecs in this class provide the following mappings:
23-
*
24-
* <table summary="Supported Mappings">
25-
* <tr>
26-
* <th>Codec</th>
27-
* <th>CQL type</th>
28-
* <th>Java type</th>
29-
* </tr>
30-
* <tr>
31-
* <td>{@link com.datastax.driver.extras.codecs.date.SimpleTimestampCodec}</td>
32-
* <td>{@link com.datastax.driver.core.DataType#timestamp() timestamp}</td>
33-
* <td>{@code long} (representing milliseconds since the Epoch)</td>
34-
* </tr>
35-
* <tr>
36-
* <td>{@link com.datastax.driver.extras.codecs.date.SimpleDateCodec}</td>
37-
* <td>{@link com.datastax.driver.core.DataType#date() date}</td>
38-
* <td>{@code int} (representing days since the Epoch)</td>
39-
* </tr>
40-
* </table>
4121
*/
4222
package com.datastax.driver.extras.codecs.date;

driver-extras/src/main/java/com/datastax/driver/extras/codecs/guava/package-info.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,5 @@
1818
* This package contains a collection of convenience
1919
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
2020
* serializing between CQL types and Guava-specific Java types.
21-
*
22-
* Currently only {@link com.datastax.driver.extras.codecs.guava.OptionalCodec OptionalCodec}
23-
* is provided.
2421
*/
2522
package com.datastax.driver.extras.codecs.guava;

driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
/**
4444
* <p>
45-
* {@link TypeCodec} that maps {@link Instant} <-> {@link Date}
46-
* allowing the setting and retrieval of <code>timestamp</code>
45+
* {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp}
46+
* allowing the setting and retrieval of {@code timestamp}
4747
* columns as {@link Instant} instances.
4848
* </p>
4949
*
@@ -53,7 +53,8 @@
5353
* </p>
5454
*
5555
* @see ZonedDateTimeCodec
56-
* @see "https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps"
56+
* @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a>
57+
* section of CQL specification.
5758
*/
5859
public class InstantCodec extends TypeCodec<Instant> {
5960

driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
/**
3737
* {@link TypeCodec} that maps
38-
* {@link java.time.LocalDate} to CQL <code>date</code> columns.
38+
* {@link java.time.LocalDate} to CQL {@code date}.
3939
*/
4040
public class LocalDateCodec extends TypeCodec<LocalDate> {
4141

driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
import static com.datastax.driver.core.ParseUtils.quote;
2929

3030
/**
31-
* {@link TypeCodec} that maps {@link LocalTime} <-> CQL time (long representing nanoseconds since midnight)
32-
* allowing the setting and retrieval of <code>time</code> columns as {@link LocalTime}
33-
* instances.
31+
* {@link TypeCodec} that maps {@link LocalTime} to CQL {@code time} (long representing nanoseconds since midnight).
3432
*/
3533
public class LocalTimeCodec extends TypeCodec<LocalTime> {
3634

driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
/**
4242
* <p>
4343
* {@link TypeCodec} that maps
44-
* {@link ZonedDateTime} <-> <code>tuple&lt;timestamp,varchar&gt;</code>
44+
* {@link ZonedDateTime} to CQL {@code tuple<timestamp,varchar>},
4545
* providing a pattern for maintaining timezone information in
4646
* Cassandra.
4747
*
@@ -53,6 +53,9 @@
5353
* persisted in the <code>varchar</code> field such that when the
5454
* value is deserialized the timezone is
5555
* preserved.
56+
*
57+
* @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a>
58+
* section of CQL specification.
5659
*/
5760
public class ZonedDateTimeCodec extends TypeCodec.AbstractTupleCodec<ZonedDateTime> {
5861

driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/package-info.java

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,13 @@
1717
/**
1818
* This package contains a collection of convenience
1919
* {@link com.datastax.driver.core.TypeCodec TypeCodec} instances useful for
20-
* serializing between CQL types and JDK 8 types, such as the ones from the
21-
* {@code java.time} API and {@link java.util.Optional}.
22-
* <p>
23-
* The codecs in this class provide the following mappings:
20+
* serializing between CQL types and Java 8 types, such as the ones from the
21+
* {@link java.time} API and {@link java.util.Optional}.
2422
*
25-
* <table summary="Supported Mappings">
26-
* <tr>
27-
* <th>Codec</th>
28-
* <th>CQL type</th>
29-
* <th>JDK 8 type</th>
30-
* </tr>
31-
* <tr>
32-
* <td>{@link com.datastax.driver.extras.codecs.jdk8.OptionalCodec}</td>
33-
* <td>Any</td>
34-
* <td>{@link java.util.Optional Optional}</td>
35-
* </tr>
36-
* <tr>
37-
* <td>{@link com.datastax.driver.extras.codecs.jdk8.LocalTimeCodec}</td>
38-
* <td>{@link com.datastax.driver.core.DataType#time() time}</td>
39-
* <td>{@link java.time.LocalTime LocalTime}</td>
40-
* </tr>
41-
* <tr>
42-
* <td>{@link com.datastax.driver.extras.codecs.jdk8.LocalDateCodec}</td>
43-
* <td>{@link com.datastax.driver.core.DataType#date() date}</td>
44-
* <td>{@link java.time.LocalDate LocalDate}</td>
45-
* </tr>
46-
* <tr>
47-
* <td>{@link com.datastax.driver.extras.codecs.jdk8.InstantCodec}</td>
48-
* <td>{@link com.datastax.driver.core.DataType#timestamp() timestamp}</td>
49-
* <td>{@link java.time.Instant Instant}</td>
50-
* </tr>
51-
* <tr>
52-
* <td>{@link com.datastax.driver.extras.codecs.jdk8.ZonedDateTimeCodec}</td>
53-
* <td>{@link com.datastax.driver.core.TupleType tuple} of
54-
* ({@link com.datastax.driver.core.DataType#timestamp() timestamp},
55-
* {@link com.datastax.driver.core.DataType#varchar() varchar})</td>
56-
* <td>{@link java.time.ZonedDateTime ZonedDateTime}</td>
57-
* </tr>
58-
* </table>
23+
* <p>
24+
* Note that, while the driver remains globally compatible with older JDKs,
25+
* classes in this package require the presence of a Java 8 or higher
26+
* at runtime.
5927
*
6028
*/
6129
package com.datastax.driver.extras.codecs.jdk8;

0 commit comments

Comments
 (0)