Skip to content

Commit

Permalink
refactor: update annotation doc and optimize JavaStringCompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Deng-Ran committed May 19, 2024
1 parent 31873bf commit fcbd766
Show file tree
Hide file tree
Showing 44 changed files with 213 additions and 65 deletions.
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/AsciiCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* ASCII type codec.
* Codec for ASCII type.
* This codec handles the encoding and decoding of ASCII characters.
* It is used in conjunction with the AsciiType annotation.
* The codec ensures that the ASCII value does not exceed the maximum value for a byte.
* If the value exceeds the maximum, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/BinaryCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
import java.util.stream.IntStream;

/**
* Byte array type codec.
* Codec for handling byte array type.
* This codec is responsible for encoding and decoding byte array types.
* It provides support for both primitive byte array and wrapper Byte array, as well as collections of Byte.
* It is used in conjunction with the BinaryType annotation.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
import java.util.stream.IntStream;

/**
* Boolean array type codec.
* Codec for Boolean array type.
* This codec is responsible for encoding and decoding Boolean array types.
* It provides support for both primitive boolean array and wrapper Boolean array, as well as collections of Boolean.
* It is used in conjunction with the BoolArrayType annotation.
*
* @author Deng Ran
* @since 3.8.3
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/BoolCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Bool type codec.
* Codec for Boolean type.
* This codec is responsible for encoding and decoding Boolean types.
* It is used in conjunction with the BoolType annotation.
* The codec ensures that the Boolean value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/ByteCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Byte type codec.
* Codec for Byte type.
* This codec is responsible for encoding and decoding Byte types.
* It is used in conjunction with the Int8Type annotation.
* The codec ensures that the Byte value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
import java.util.stream.IntStream;

/**
* UInt16 array type codec.
* Codec for Char array type.
* This codec is responsible for encoding and decoding Char array types.
* It provides support for both primitive char array and wrapper Character array, as well as collections of Character.
* It is used in conjunction with the CharArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/CharCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Char type codec.
* Codec for Character type.
* This codec is responsible for encoding and decoding Character types.
* It is used in conjunction with the CharType annotation.
* The codec ensures that the Character value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.8.4
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@


/**
* Codec interface.
* Interface for Codec.
* This interface defines the structure for a Codec in the fastproto library.
* A Codec is responsible for encoding and decoding data.
* It provides methods for decoding from a CodecContext and ByteBufferInputStream, and encoding into a ByteBufferOutputStream.
* It is implemented by various classes to handle different types of data.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/CodecContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
import java.util.function.Supplier;

/**
* Codec context.
* The CodecContext class.
* This class is used to store the context for a codec operation in the fastproto library.
* It contains information such as the default byte order, bit order, field type, field, and data type annotation.
* The class provides methods to retrieve the data type annotation and to get the byte and bit order.
*
* @author Deng Ran
* @since 3.2.2
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/DateCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
import java.util.Date;

/**
* Date type codec.
* Codec for Date type.
* This codec is responsible for encoding and decoding Date types.
* It is used in conjunction with the TimeType annotation.
* The codec ensures that the Date value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
* It also provides additional codecs for Timestamp, Calendar, Instant, and LocalDateTime types.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
import java.util.stream.Stream;

/**
* Double array type codec.
* Codec for Double Array type.
* This codec is responsible for encoding and decoding double array types.
* It provides support for both primitive double array and wrapper Double array, as well as collections of Double.
* It is used in conjunction with the DoubleArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/DoubleCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Double type codec.
* Codec for Double type.
* This codec is responsible for encoding and decoding Double types.
* It is used in conjunction with the DoubleType annotation.
* The codec ensures that the Double value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/EnumCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
import java.util.function.Function;

/**
* Enum type codec.
* Codec for Enum type.
* This codec is responsible for encoding and decoding Enum types.
* It is used in conjunction with the EnumType annotation.
* The codec ensures that the Enum value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
import java.util.stream.IntStream;

/**
* Float array type codec.
* Codec for Float Array type.
* This codec is responsible for encoding and decoding float array types.
* It provides support for both primitive float array and wrapper Float array, as well as collections of Float.
* It is used in conjunction with the FloatArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/FloatCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Float type codec.
* Codec for Float type.
* This codec is responsible for encoding and decoding Float types.
* It is used in conjunction with the FloatType annotation.
* The codec ensures that the Float value is correctly encoded and decoded.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import java.util.stream.Stream;

/**
* Int16 array type codec.
* Codec for Int16 Array type.
* This codec is responsible for encoding and decoding Int16 array types.
* It provides support for both primitive Int16 array and wrapper Integer array, as well as collections of Integer.
* It is used in conjunction with the Int16ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/Int16Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Int16 type codec.
* Codec for Int16 type.
* This codec is responsible for encoding and decoding Int16 types.
* It is used in conjunction with the Int16Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import java.util.stream.Stream;

/**
* Int32 array type codec.
* Codec for Int32 Array type.
* This codec is responsible for encoding and decoding Int32 array types.
* It provides support for both primitive Int32 array and wrapper Integer array, as well as collections of Integer.
* It is used in conjunction with the Int32ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/Int32Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Int32 type codec.
* Codec for Int32 type.
* This codec is responsible for encoding and decoding Int32 types.
* It is used in conjunction with the Int32Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
import java.util.stream.Stream;

/**
* Int64 array type codec.
* Codec for Int64 Array type.
* This codec is responsible for encoding and decoding Int64 array types.
* It provides support for both primitive Int64 array and wrapper Long array, as well as collections of Long.
* It is used in conjunction with the Int64ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/Int64Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Int64 type codec.
* Codec for Int64 type.
* This codec is responsible for encoding and decoding Int64 types.
* It is used in conjunction with the Int64Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
import java.util.stream.Stream;

/**
* Int8 array type codec.
* Codec for Int8 Array type.
* This codec is responsible for encoding and decoding Int8 array types.
* It provides support for both primitive Int8 array and wrapper Integer array, as well as collections of Integer.
* It is used in conjunction with the Int8ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/Int8Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Int8 type codec.
* Codec for Int8 type.
* This codec is responsible for encoding and decoding Int8 types.
* It is used in conjunction with the Int8Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
import java.util.stream.IntStream;

/**
* Short array type codec.
* Codec for Short Array type.
* This codec is responsible for encoding and decoding Short array types.
* It provides support for both primitive Short array and wrapper Short array, as well as collections of Short.
* It is used in conjunction with the Int16ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/ShortCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* Short type codec.
* Codec for Short type.
* This codec is responsible for encoding and decoding Short types.
* It is used in conjunction with the Int16Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/StringCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
import java.nio.charset.Charset;

/**
* String type codec.
* Codec for String type.
* This codec is responsible for encoding and decoding String types.
* It is used in conjunction with the StringType annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import java.util.stream.Stream;

/**
* UInt16 array type codec.
* Codec for UInt16 Array type.
* This codec is responsible for encoding and decoding UInt16 array types.
* It provides support for both primitive UInt16 array and wrapper Integer array, as well as collections of Integer.
* It is used in conjunction with the UInt16ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/UInt16Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* UInt16 type codec.
* Codec for UInt16 type.
* This codec is responsible for encoding and decoding UInt16 types.
* It is used in conjunction with the UInt16Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
import java.util.stream.Stream;

/**
* UInt32 array type codec.
* Codec for UInt32 Array type.
* This codec is responsible for encoding and decoding UInt32 array types.
* It provides support for both primitive UInt32 array and wrapper Long array, as well as collections of Long.
* It is used in conjunction with the UInt32ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/UInt32Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import org.indunet.fastproto.io.ByteBufferOutputStream;

/**
* UInt32 type codec.
* Codec for UInt32 type.
* This codec is responsible for encoding and decoding UInt32 types.
* It is used in conjunction with the UInt32Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import java.util.stream.IntStream;

/**
* UInt64 array type codec.
* Codec for UInt64 Array type.
* This codec is responsible for encoding and decoding UInt64 array types.
* It provides support for both primitive UInt64 array and wrapper BigInteger array, as well as collections of BigInteger.
* It is used in conjunction with the UInt64ArrayType annotation.
*
* @author Deng Ran
* @since 3.6.0
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/indunet/fastproto/codec/UInt64Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
import java.math.BigInteger;

/**
* UInt64 type codec.
* Codec for UInt64 type.
* This codec is responsible for encoding and decoding UInt64 types.
* It is used in conjunction with the UInt64Type annotation.
* If there are any issues during the encoding or decoding process, an exception is thrown.
*
* @author Deng Ran
* @since 3.2.1
Expand Down
Loading

0 comments on commit fcbd766

Please sign in to comment.