Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some code cleanup to use Java 7 language features, add annotations
- Loading branch information
Showing
7 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package gnu.java.zrtp.annotations; | ||
|
||
/** | ||
* Annotations to check for allowed integer constants. | ||
* | ||
* Shamelessly copied from Android's IntDef annotation: core/java/android/annotation/IntDef.java | ||
* | ||
* Created by werner on 03.01.16. | ||
*/ | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | ||
import static java.lang.annotation.RetentionPolicy.CLASS; | ||
|
||
@Retention(CLASS) | ||
@Target({ANNOTATION_TYPE}) | ||
public @interface IntDef { | ||
/** Defines the allowed constants for this element */ | ||
long[] value() default {}; | ||
/** Defines whether the constants can be used as a flag, or just as an enum (the default) */ | ||
boolean flag() default false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package gnu.java.zrtp.annotations; | ||
|
||
/** | ||
* | ||
* Annotations to define a NonNull value. | ||
* | ||
* Shamelessly copied from Android's IntDef annotation: core/java/android/annotation/NonNull.java | ||
* | ||
* Created by werner on 03.01.16. | ||
*/ | ||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
/** | ||
* Denotes that a parameter, field or method return value can never be null. | ||
* <p/> | ||
* This is a marker annotation and it has no specific attributes. | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({METHOD,PARAMETER,LOCAL_VARIABLE,FIELD}) | ||
public @interface NonNull { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters