projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove more unused classes
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
TemporaryImage.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/TemporaryImage.java
b/src/main/java/net/pterodactylus/sone/data/TemporaryImage.java
index
5e7c78d
..
378a348
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/TemporaryImage.java
+++ b/
src/main/java/net/pterodactylus/sone/data/TemporaryImage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - TemporaryImage.java - Copyright © 2011–201
2
David Roden
+ * Sone - TemporaryImage.java - Copyright © 2011–201
9
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-17,15
+17,14
@@
package net.pterodactylus.sone.data;
package net.pterodactylus.sone.data;
-import java.util.UUID;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
-import
net.pterodactylus.util.validation.Validation
;
+import
java.util.UUID
;
/**
* A temporary image stores an uploaded image in memory until it has been
* inserted into Freenet and is subsequently loaded from there.
/**
* A temporary image stores an uploaded image in memory until it has been
* inserted into Freenet and is subsequently loaded from there.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class TemporaryImage {
*/
public class TemporaryImage {
@@
-82,7
+81,8
@@
public class TemporaryImage {
* @return This temporary image
*/
public TemporaryImage setMimeType(String mimeType) {
* @return This temporary image
*/
public TemporaryImage setMimeType(String mimeType) {
- Validation.begin().isNotNull("MIME Type", mimeType).isNull("Previous MIME Type", this.mimeType).check();
+ checkNotNull(mimeType, "mimeType must not be null");
+ checkState(this.mimeType == null, "mime type must not already be set");
this.mimeType = mimeType;
return this;
}
this.mimeType = mimeType;
return this;
}
@@
-105,7
+105,8
@@
public class TemporaryImage {
* @return This temporary image
*/
public TemporaryImage setImageData(byte[] imageData) {
* @return This temporary image
*/
public TemporaryImage setImageData(byte[] imageData) {
- Validation.begin().isNotNull("Image Data", imageData).isNull("Previous Image Data", this.imageData).check();
+ checkNotNull(imageData, "imageData must not be null");
+ checkState(this.imageData == null, "image data must not already be set");
this.imageData = imageData;
return this;
}
this.imageData = imageData;
return this;
}