Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit ee10aae

Browse files
add annotations
1 parent 6b61305 commit ee10aae

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package top.offsetmonkey538.offsetutils538.api.annotation;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* Indicates that the annotated {@link java.util.Collection} or {@link java.util.Map} is unmodifiable.
11+
* <br>
12+
* Mutator methods of annotated elements will throw exceptions or have no effect.
13+
* @see UnmodifiableView
14+
*/
15+
@Documented
16+
@Retention(RetentionPolicy.CLASS)
17+
@Target({ElementType.TYPE_USE})
18+
public @interface Unmodifiable {
19+
20+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package top.offsetmonkey538.offsetutils538.api.annotation;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* Indicates that the annotated {@link java.util.Collection} or {@link java.util.Map} is unmodifiable.
11+
* <br>
12+
* Mutator methods of annotated elements will throw exceptions or have no effect.
13+
* <p>The content of the collection or map could however still be mutated by other code.</p>
14+
* @see Unmodifiable
15+
*/
16+
@Documented
17+
@Retention(RetentionPolicy.CLASS)
18+
@Target({ElementType.TYPE_USE})
19+
public @interface UnmodifiableView {
20+
21+
}

0 commit comments

Comments
 (0)