PersistentSequenceKey.java
3.08 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package com.diligrp.assistant.uid.domain;
import java.time.LocalDate;
/**
* KEY-ID生成器数据库模型
*/
public class PersistentSequenceKey {
/**
* ID主键
*/
private Long id;
/**
* KEY标识
*/
private String key;
/**
* 名称
*/
private String name;
/**
* 起始值
*/
private Long value;
/**
* 步长
*/
private Integer step;
/**
* ID格式
*/
private String pattern;
/**
* 有效日期
*/
private LocalDate expiredOn;
/**
* 当前日期-循环ID生成器使用
*/
private LocalDate today;
/**
* 数据版本
*/
private Integer version;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getValue() {
return value;
}
public void setValue(Long value) {
this.value = value;
}
public Integer getStep() {
return step;
}
public void setStep(Integer step) {
this.step = step;
}
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public LocalDate getExpiredOn() {
return expiredOn;
}
public void setExpiredOn(LocalDate expiredOn) {
this.expiredOn = expiredOn;
}
public LocalDate getToday() {
return today;
}
public void setToday(LocalDate today) {
this.today = today;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public static Builder builder() {
return new PersistentSequenceKey().new Builder();
}
public class Builder {
public Builder key(String key) {
PersistentSequenceKey.this.key = key;
return this;
}
public Builder name(String name) {
PersistentSequenceKey.this.name = name;
return this;
}
public Builder value(Long value) {
PersistentSequenceKey.this.value = value;
return this;
}
public Builder step(Integer step) {
PersistentSequenceKey.this.step = step;
return this;
}
public Builder pattern(String pattern) {
PersistentSequenceKey.this.pattern = pattern;
return this;
}
public Builder expiredOn(LocalDate expiredOn) {
PersistentSequenceKey.this.expiredOn = expiredOn;
return this;
}
public Builder version(Integer version) {
PersistentSequenceKey.this.version = version;
return this;
}
public PersistentSequenceKey build() {
return PersistentSequenceKey.this;
}
}
}