kr.co.hit.live.id.impl
Class UUIdGenerator
java.lang.Object
kr.co.hit.live.id.impl.UUIdGenerator
- All Implemented Interfaces:
- IdGenerator
public class UUIdGenerator
- extends Object
- implements IdGenerator
UUID를 생성하는 클래스이다. UUID의 구조는 다음과 같다.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| currentTimeMillis | IP Address | Unique Object Hashcode | Random number |
- Since:
- 4.0
- Author:
- 김형도
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UUIdGenerator
public UUIdGenerator()
getInstance
public static UUIdGenerator getInstance()
getNextId
public String getNextId()
getNextId
public String getNextId(Object key)
- Description copied from interface:
IdGenerator
- 아이디를 생성하는 메소드이다.
- Specified by:
getNextId in interface IdGenerator
- Parameters:
key - 구현에 따라서 추가적인 정보가 필요할 경우 사용한다.
- Returns:
- 생성된 ID 정보를 담고 있는 객체이다.
getNextId
public String getNextId(Object key,
boolean format)
- UUID를 생성하여 리턴한다.
IdGenerator 인터페이스의 구현 메소드이다.
Copyright © 2014. All Rights Reserved.