Skip to content

Instantly share code, notes, and snippets.

View Elyorbe's full-sized avatar
🏓

Elyorbek Ibrokhimov Elyorbe

🏓
View GitHub Profile
@Elyorbe
Elyorbe / EnumType.java
Created July 31, 2025 06:39
Enum type commonization
import java.util.Optional;
public interface EnumType {
String getCode();
String getDescription();
static <E extends Enum<E> & EnumType> Optional<E> fromCode(Class<E> enumType, String code) {
return EnumValueResolver.fromCode(enumType, code);