Skip to content

Commit a6b65be

Browse files
committed
MaxFileSize: use @Getter and @requiredargsconstructor.
Should be in c58dc51 commit. No functional changes.
1 parent 252dc70 commit a6b65be

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/main/java/ru/mystamps/web/validation/jsr303/MaxFileSize.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
import javax.validation.Constraint;
2525
import javax.validation.Payload;
2626

27+
import lombok.Getter;
28+
import lombok.RequiredArgsConstructor;
29+
2730
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
2831
import static java.lang.annotation.ElementType.FIELD;
2932
import static java.lang.annotation.ElementType.METHOD;
@@ -43,17 +46,11 @@
4346
long value();
4447
Unit unit();
4548

49+
@Getter
50+
@RequiredArgsConstructor
4651
enum Unit {
4752
bytes(1), Kbytes(1024), Mbytes(1024 * 1024);
4853

49-
private long size;
50-
51-
Unit(long size) {
52-
this.size = size;
53-
}
54-
55-
public long getSize() {
56-
return size;
57-
}
54+
private final long size;
5855
}
5956
}

0 commit comments

Comments
 (0)