Skip to content

Commit

Permalink
Update kala.annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed May 1, 2024
1 parent 3c72b6e commit 427ae5f
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 31 deletions.
33 changes: 24 additions & 9 deletions kala-base/src/main/java/kala/annotations/Contravariant.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target(ElementType.TYPE_PARAMETER)
@Retention(RetentionPolicy.SOURCE)
public @interface Contravariant {
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target(ElementType.TYPE_PARAMETER)
@Retention(RetentionPolicy.SOURCE)
public @interface Contravariant {
}
15 changes: 15 additions & 0 deletions kala-base/src/main/java/kala/annotations/Covariant.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;
Expand Down
15 changes: 15 additions & 0 deletions kala-base/src/main/java/kala/annotations/DelegateBy.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;
Expand Down
35 changes: 25 additions & 10 deletions kala-base/src/main/java/kala/annotations/ReplaceWith.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
public @interface ReplaceWith {
String value();
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
public @interface ReplaceWith {
String value();
}
39 changes: 27 additions & 12 deletions kala-base/src/main/java/kala/annotations/StaticClass.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
package kala.annotations;

import java.lang.annotation.*;

/**
* Annotate a class as a static class, which cannot be instantiated.
*/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface StaticClass {
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

/**
* Annotate a class as a static class, which cannot be instantiated.
*/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface StaticClass {
}
15 changes: 15 additions & 0 deletions kala-base/src/main/java/kala/annotations/UnstableName.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;
Expand Down

0 comments on commit 427ae5f

Please sign in to comment.