Craig Raw
2 years ago
3 changed files with 26 additions and 2 deletions
@ -0,0 +1,23 @@ |
|||
package com.sparrowwallet.sparrow; |
|||
|
|||
public enum Interface { |
|||
DESKTOP, TERMINAL, SERVER; |
|||
|
|||
private static Interface currentInterface; |
|||
|
|||
public static Interface get() { |
|||
if(currentInterface == null) { |
|||
currentInterface = DESKTOP; |
|||
} |
|||
|
|||
return currentInterface; |
|||
} |
|||
|
|||
public static void set(Interface interf) { |
|||
if(currentInterface != null && interf != currentInterface) { |
|||
throw new IllegalStateException("Interface already set to " + currentInterface); |
|||
} |
|||
|
|||
currentInterface = interf; |
|||
} |
|||
} |
Loading…
Reference in new issue