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; //Либо ошибку какую-нибудь выкинуть | |
| } | |
| } |