Lightweight Java annotation utilities used across Codirex projects.
This repository contains a small collection of source-only annotations (and supporting tools) that help document intent and perform validation in build- and runtime tools.
Highlights
- Small, dependency-free annotations for nullability, immutability, validation constraints, and API stability.
- Well-documented Javadoc available in the repository (see the
build/docs/javadocfolder). - Packaged as
org.codirex.annotation:annotation:1.0.0(see your build artifacts underbuild/libs).
Maven / Gradle Coordinates
Gradle (Kotlin DSL)
repositories {
mavenCentral()
}
dependencies {
implementation("org.codirex.annotation:annotation:1.0.0")
}Maven
<dependency>
<groupId>org.codirex.annotation</groupId>
<artifactId>annotation</artifactId>
<version>1.0.0</version>
</dependency>Quick Start
Common annotations included in this library:
@NonNull/@Nullable— nullability markers for fields, parameters, and return values.@Immutable— indicates an immutable type (no visible mutators).@Builder— marker for types that provide builder-style construction.@Internal/@Beta— API stability markers to communicate intended audience and stability.@Min/@Max— simple numeric constraint annotations for documentation and validation.
Example
import org.codirex.annotation.NonNull;
import org.codirex.annotation.Immutable;
@Immutable
public final class Person {
private final String name;
public Person(@NonNull String name) {
this.name = name;
}
@NonNull
public String getName() {
return name;
}
}Javadoc
A Javadoc site is generated during the build and checked into build/docs/javadoc in this repository. Open build/docs/javadoc/index.html in a browser to explore the API docs.
Building and Testing
Use the Gradle wrapper included with the project to build and run tests.
On Windows PowerShell:
# Clean and build
.\gradlew.bat clean build
# Run tests
.\gradlew.bat testPublishing
This project includes configuration for publishing artifacts (see build.gradle.kts and the publishing outputs under build/). If you plan to publish to Maven Central or another repository, review the Gradle publishing configuration and credentials in your CI.
Contributing
Contributions are welcome. A few guidelines:
- Follow existing coding styles found under
src/main/java. - Provide unit tests for new behavior, keep changes small and focused.
- Update Javadoc when adding or changing annotations.
License
See the repository LICENSE file for license and copyright details. If the file is missing, add the preferred license file to the project root.
Support / Questions
If you have questions about using these annotations or about publishing, open an issue in the repository or reach out to the maintainers.
-- Generated README for the Codirex Annotation library. Update versions and examples to match your project's needs.