add Config Wrapper for .env
This commit is contained in:
		
							
								
								
									
										20
									
								
								app/src/main/java/net/tomatentum/tomatenmusic3/Config.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/src/main/java/net/tomatentum/tomatenmusic3/Config.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | |||||||
|  | package net.tomatentum.tomatenmusic3; | ||||||
|  |  | ||||||
|  | import io.github.cdimascio.dotenv.Dotenv; | ||||||
|  |  | ||||||
|  | public class Config { | ||||||
|  |  | ||||||
|  |     private Dotenv env; | ||||||
|  |  | ||||||
|  |     public Config(Dotenv env) { | ||||||
|  |         this.env = env; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public String token() { | ||||||
|  |         return env.get("TOKEN"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public boolean isDevelopment() { | ||||||
|  |         return env.get("ENVIRONMENT").equals("Development"); | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user