compile group: 'net.pterodactylus', name: 'utils', version: '0.12.4'
compile group: 'com.google.inject', name: 'guice', version: '3.0'
compile group: 'com.google.guava', name: 'guava', version: '14.0.1'
- compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.1.2'
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.0.1'
import static com.google.common.base.Preconditions.checkState;
-import org.apache.commons.lang.StringUtils;
-
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.database.PostBuilder;
import net.pterodactylus.sone.database.SoneProvider;
checkState((randomId && (id == null)) || (!randomId && (id != null)), "exactly one of random ID or custom ID must be set");
checkState(senderId != null, "sender must not be null");
checkState((currentTime && (time == 0)) || (!currentTime && (time > 0)), "one of current time or custom time must be set");
- checkState(!StringUtils.isBlank(text), "text must not be empty");
+ checkState((text != null) && !text.trim().isEmpty(), "text must not be empty");
checkState((recipientId == null) || !recipientId.equals(senderId), "sender and recipient must not be the same");
}
import static com.google.common.base.Preconditions.checkState;
-import org.apache.commons.lang.StringUtils;
-
import net.pterodactylus.sone.database.PostReplyBuilder;
/**
checkState((randomId && (id == null)) || (!randomId && (id != null)), "either random ID nor custom ID must be set");
checkState(senderId != null, "sender must not be null");
checkState((currentTime && (time == 0)) || (!currentTime && (time >= 0)), "either current time or custom time must be set");
- checkState(!StringUtils.isBlank(text), "text must not be empty");
+ checkState((text != null) && !text.trim().isEmpty(), "text must not be empty");
checkState(postId != null, "post must not be null");
}
import net.pterodactylus.sone.database.PostReplyBuilder;
import net.pterodactylus.sone.database.SoneProvider;
-import org.apache.commons.lang.StringUtils;
-
/**
* {@link PostReplyBuilder} implementation that creates {@link PostReplyImpl}
* objects.
checkState((randomId && (id == null)) || (!randomId && (id != null)), "either random ID nor custom ID must be set");
checkState(senderId != null, "sender must not be null");
checkState((currentTime && (time == 0)) || (!currentTime && (time >= 0)), "either current time or custom time must be set");
- checkState(!StringUtils.isBlank(text), "text must not be empty");
+ checkState((text != null) && !text.trim().isEmpty(), "text must not be empty");
checkState(postId != null, "post must not be null");
/* create new post reply. */