From e5c50ae35e188ffce267805b28cab6280f2e1a3a Mon Sep 17 00:00:00 2001 From: chaitanyapotti Date: Tue, 20 Oct 2020 16:16:05 +0800 Subject: [PATCH] use string enums --- .idea/dictionaries/chai.xml | 2 + torusdirect/build.gradle | 2 +- .../types/AggregateVerifierType.java | 15 +++++++- .../torusdirect/types/LoginType.java | 38 ++++++++++++------- .../torusdirect/types/TorusNetwork.java | 17 ++++++++- 5 files changed, 57 insertions(+), 17 deletions(-) diff --git a/.idea/dictionaries/chai.xml b/.idea/dictionaries/chai.xml index 4656c60..17553a4 100644 --- a/.idea/dictionaries/chai.xml +++ b/.idea/dictionaries/chai.xml @@ -3,8 +3,10 @@ discordapp linkedin + mainnet reddit stringified + testnet weibo diff --git a/torusdirect/build.gradle b/torusdirect/build.gradle index 16c90ed..1f4bfe1 100644 --- a/torusdirect/build.gradle +++ b/torusdirect/build.gradle @@ -11,7 +11,7 @@ android { minSdkVersion 26 targetSdkVersion 30 versionCode 1 - versionName "1.0.6" + versionName "1.0.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' diff --git a/torusdirect/src/main/java/org/torusresearch/torusdirect/types/AggregateVerifierType.java b/torusdirect/src/main/java/org/torusresearch/torusdirect/types/AggregateVerifierType.java index cb14119..9b908b8 100644 --- a/torusdirect/src/main/java/org/torusresearch/torusdirect/types/AggregateVerifierType.java +++ b/torusdirect/src/main/java/org/torusresearch/torusdirect/types/AggregateVerifierType.java @@ -1,5 +1,18 @@ package org.torusresearch.torusdirect.types; +import org.jetbrains.annotations.NotNull; + public enum AggregateVerifierType { - SINGLE_VERIFIER_ID + SINGLE_VERIFIER_ID("single_verifier_id"); + + private String verifierType; + + AggregateVerifierType(String verifierType) { + this.verifierType = verifierType; + } + + @NotNull + public String toString() { + return verifierType; + } } diff --git a/torusdirect/src/main/java/org/torusresearch/torusdirect/types/LoginType.java b/torusdirect/src/main/java/org/torusresearch/torusdirect/types/LoginType.java index cd59412..0f4c156 100644 --- a/torusdirect/src/main/java/org/torusresearch/torusdirect/types/LoginType.java +++ b/torusdirect/src/main/java/org/torusresearch/torusdirect/types/LoginType.java @@ -1,17 +1,29 @@ package org.torusresearch.torusdirect.types; +import org.jetbrains.annotations.NotNull; + public enum LoginType { - GOOGLE, - FACEBOOK, - REDDIT, - DISCORD, - TWITCH, - APPLE, - GITHUB, - LINKEDIN, - TWITTER, - WEIBO, - LINE, - EMAIL_PASSWORD, - JWT + GOOGLE("google"), + FACEBOOK("facebook"), + REDDIT("reddit"), + DISCORD("discord"), + TWITCH("twitch"), + APPLE("apple"), + GITHUB("github"), + LINKEDIN("linkedin"), + TWITTER("twitter"), + WEIBO("weibo"), + LINE("line"), + EMAIL_PASSWORD("email_password"), + JWT("jwt"); + private String loginType; + + LoginType(String loginType) { + this.loginType = loginType; + } + + @NotNull + public String toString() { + return loginType; + } } diff --git a/torusdirect/src/main/java/org/torusresearch/torusdirect/types/TorusNetwork.java b/torusdirect/src/main/java/org/torusresearch/torusdirect/types/TorusNetwork.java index ad58cf8..abb3e91 100644 --- a/torusdirect/src/main/java/org/torusresearch/torusdirect/types/TorusNetwork.java +++ b/torusdirect/src/main/java/org/torusresearch/torusdirect/types/TorusNetwork.java @@ -1,6 +1,19 @@ package org.torusresearch.torusdirect.types; +import org.jetbrains.annotations.NotNull; + public enum TorusNetwork { - MAINNET, - TESTNET + MAINNET("mainnet"), + TESTNET("testnet"); + + private String network; + + TorusNetwork(String network) { + this.network = network; + } + + @NotNull + public String toString() { + return network; + } }