관리 메뉴

HAMA 블로그

자바 EnumBitSet 사용하기 본문

Java

자바 EnumBitSet 사용하기

[하마] 이승현 (wowlsh93@gmail.com) 2015. 9. 1. 11:50

http://claude-martin.ch/enumbitset/  참조 (라이브러리 여기있음)


Project EnumBitSet

This is the project home for EnumBitSet. It's a small project offering more functionality with enum types in Java.

Java 8 is needed to use any of the code!!

Is EnumBitSet the right thing for you?

Do you know this situation: You have created some enum types in Java and now you want to use them but you don't know how to store them in a database? Hibernate and JPA can help you but ORM isn't always the best approach. Maybe you just want to have more control on how the data is stored to the database. 
EnumBitSet can help you working with sets of enum constants and storing those sets in one single database field. Just use the method toLong() if you are sure that there are not more than 64 elements in the enum type. Or use toBigInteger() for enum types of any size. 
This library also offers a more general interface to bit sets that are restricted by a domain (universe). Three implementations exist:

  • EnumBitSet (for enum types, mutable)
  • GeneralDomainBitSet (for all types, mutable)
  • SmallDomainBitSet (for up to 64 elements of any type, immutable)


'Java' 카테고리의 다른 글

자바로 MS 문서 다루기  (0) 2015.11.05
C++ 멤버변수 와 자바 멤버변수 초기화  (0) 2015.09.26
자바 enum 정리  (0) 2015.09.01
자바 volatile / C volatile 정리  (0) 2015.09.01
자바 Concurrent 라이브러리 정리  (0) 2015.08.31
Comments