Skip to content

ph annotations

Philip Helger edited this page Apr 8, 2026 · 1 revision

Custom Java annotations used throughout the ph-* projects for nullness, thread safety, code style and documentation purposes.

Key annotations include:

  • Thread safety: @ThreadSafe, @NotThreadSafe, @Immutable, @GuardedBy
  • Code style: @PresentForCodeCoverage, @VisibleForTesting, @UsedViaReflection, @OverrideOnDemand
  • Return types: @ReturnsMutableCopy, @ReturnsMutableObject, @ReturnsImmutableObject
  • Constraints: @Nonempty, @Nonnegative
  • Lifecycle: @Since, @Until, @WorkInProgress, @DevelopersNote

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.commons</groupId>
  <artifactId>ph-annotations</artifactId>
  <version>x.y.z</version>
</dependency>

Clone this wiki locally