Last active
April 12, 2019 21:38
-
-
Save Hiraev/4da198edbe015a75bc5087ed58526d64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| protected static <T extends AbstractRegister> T valueOf(@NonNull String str, @NonNull Class<T> clazz) { | |
| try { | |
| T reg = clazz.getConstructor().newInstance(); | |
| reg.regs = boolValueOf(str); | |
| return reg; | |
| } catch (ReflectiveOperationException e) { | |
| return null; //Либо ошибку какую-нибудь выкинуть | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment