Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions operator-annotations/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.javaoperatorsdk</groupId>
<artifactId>java-operator-sdk</artifactId>
<version>5.1.3-SNAPSHOT</version>
</parent>

<artifactId>operator-annotations</artifactId>

<properties>
<maven.compiler.source>22</maven.compiler.source>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure these properties are needed here since they should probably be inherited from the parent. Also, this code should work with Java 21.

<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
26 changes: 26 additions & 0 deletions operator-annotations/src/main/java/io/javaoperatorsdk/Sample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.javaoperatorsdk;

import java.lang.annotation.*;

/**
* This annotation marks an integration test class as a sample for the documentation.
* Intended for use on test classes only.
*
* <p><b>Example:</b>
* <pre>{@code
* @Sample(
* tldr="Usage of PrimaryToSecondaryMapper",
* description="Showcases the usage of PrimaryToSecondaryMapper, in what situation it needs to be used and how to optimize typical uses with Informer indexes."
* )
* class PrimaryToSecondaryIT {
* // details omitted
* }
* }</pre>
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
@Documented
public @interface Sample {
String tldr();
String description();
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<module>sample-operators</module>
<module>caffeine-bounded-cache-support</module>
<module>bootstrapper-maven-plugin</module>
<module>operator-annotations</module>
</modules>

<scm>
Expand Down