Skip to content

Commit

Permalink
docs: update documentation at AnnotationOperation
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Dec 28, 2023
1 parent e062690 commit 97e11be
Showing 1 changed file with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@
import java.util.List;
import java.util.stream.StreamSupport;

/**
* Enumeration representing the operations with annotations.
* Each operation defines a specific behavior when invoked.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public enum AnnotationOperation {

/**
* Represents the {@link jakarta.data.repository.Insert} operation.
*/
INSERT {
@Override
public Object invoke(Operation operation) {
Expand All @@ -38,7 +46,11 @@ public Object invoke(Operation operation) {
return returnType.isVoid() ? Void.TYPE : result;
}
}
}, UPDATE {
},
/**
* Represents the {@link jakarta.data.repository.Update} operation.
*/
UPDATE {
@Override
public Object invoke(Operation operation) {
checkParameterNumber(operation);
Expand Down Expand Up @@ -82,7 +94,11 @@ private static Object executeSingleEntity(Operation operation, Object param, Ret
return param;
}
}
}, DELETE {
},
/**
* Represents the {@link jakarta.data.repository.Delete} operation.
*/
DELETE {
@Override
public Object invoke(Operation operation) {
checkParameterNumber(operation);
Expand Down Expand Up @@ -122,7 +138,11 @@ private static Object executeSingleEntity(Operation operation, Object param, Ret
}
return null;
}
}, SAVE {
},
/**
* Represents the {@link jakarta.data.repository.Save} operation.
*/
SAVE {
@Override
public Object invoke(Operation operation) {
checkParameterNumber(operation);
Expand Down

0 comments on commit 97e11be

Please sign in to comment.