Skip to content

Commit

Permalink
Added enum support to native mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
danielperano committed Jan 12, 2024
1 parent 11eb007 commit df4161a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/main/java/com/myworldvw/buoy/NativeMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ public <T> NativeMapper register(Class<T> targetType, ObjectHandlers<T> handlers
return this;
}

public <T extends Enum<?>> NativeMapper registerEnum(T enumeration){
layouts.put(enumeration.getClass(), ValueLayout.JAVA_INT);
return this;
}

public boolean isRegistered(Class<?> targetType){
return objectHandlers.containsKey(targetType);
}
Expand Down

0 comments on commit df4161a

Please sign in to comment.