forked from Philipinho/CoinGecko-Java
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5e86fa
commit e1833e7
Showing
8 changed files
with
164 additions
and
54 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/litesoftwares/coingecko/constant/TokenType.java
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,16 @@ | ||
package com.litesoftwares.coingecko.constant; | ||
|
||
public enum TokenType { | ||
DEMO("x-cg-demo-api-key"), | ||
PRO("x-cg-demo-api-key"); | ||
|
||
private final String headerName; | ||
|
||
TokenType(String headerName) { | ||
this.headerName = headerName; | ||
} | ||
|
||
public String getHeaderName() { | ||
return headerName; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/litesoftwares/coingecko/domain/ApiToken.java
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,31 @@ | ||
package com.litesoftwares.coingecko.domain; | ||
|
||
import com.litesoftwares.coingecko.constant.TokenType; | ||
|
||
public class ApiToken { | ||
|
||
private TokenType type; | ||
|
||
private String value; | ||
|
||
public ApiToken(TokenType type, String value) { | ||
this.type = type; | ||
this.value = value; | ||
} | ||
|
||
public static ApiToken demo(String value) { | ||
return new ApiToken(TokenType.DEMO, value); | ||
} | ||
|
||
public static ApiToken pro(String value) { | ||
return new ApiToken(TokenType.PRO, value); | ||
} | ||
|
||
public TokenType getType() { | ||
return type; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
} |
Oops, something went wrong.