From 3042c35555d3fdf1e821140bd4f5e8d7e6401a13 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 21 Dec 2017 13:42:14 +0100 Subject: [PATCH] annotate via custom annotation --- .../com/owncloud/android/ui/TextDrawable.java | 2 ++ .../android/utils/NextcloudServer.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/main/java/com/owncloud/android/utils/NextcloudServer.java diff --git a/src/main/java/com/owncloud/android/ui/TextDrawable.java b/src/main/java/com/owncloud/android/ui/TextDrawable.java index 035df7943588..903a7b3e0195 100644 --- a/src/main/java/com/owncloud/android/ui/TextDrawable.java +++ b/src/main/java/com/owncloud/android/ui/TextDrawable.java @@ -30,6 +30,7 @@ import com.owncloud.android.authentication.AccountUtils; import com.owncloud.android.utils.BitmapUtils; +import com.owncloud.android.utils.NextcloudServer; import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; @@ -94,6 +95,7 @@ public TextDrawable(String text, int r, int g, int b, float radius) { * @throws NoSuchAlgorithmException if the specified algorithm is not available when calculating the color values */ @NonNull + @NextcloudServer(min = -1, max = 12) public static TextDrawable createAvatar(String accountName, float radiusInDp) throws UnsupportedEncodingException, NoSuchAlgorithmException { String username = AccountUtils.getAccountUsername(accountName); diff --git a/src/main/java/com/owncloud/android/utils/NextcloudServer.java b/src/main/java/com/owncloud/android/utils/NextcloudServer.java new file mode 100644 index 000000000000..79998ba2bc76 --- /dev/null +++ b/src/main/java/com/owncloud/android/utils/NextcloudServer.java @@ -0,0 +1,18 @@ +package com.owncloud.android.utils; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Created by tobi on 21.12.17. + */ + +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.METHOD) +public @interface NextcloudServer { + int min(); + + int max(); +} \ No newline at end of file