Rename some classes to fit Google's Java standards

This commit is contained in:
Colin McDonald 2016-06-17 01:09:28 -04:00
parent 63b1e7b2c3
commit a92dee1e6f
8 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ import com.google.common.collect.ImmutableMap;
import com.mongodb.Block;
import lombok.extern.slf4j.Slf4j;
import net.frozenorb.apiv3.model.User;
import net.frozenorb.apiv3.util.UUIDUtils;
import net.frozenorb.apiv3.util.UuidUtils;
import org.bson.Document;
import org.bson.types.ObjectId;
@ -30,7 +30,7 @@ public final class UserConverter implements Block<Document> {
UUID uuid = UUID.fromString(uuidString.replaceFirst("([0-9a-fA-F]{8})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]+)", "$1-$2-$3-$4-$5"));
if (!UUIDUtils.isAcceptableUUID(uuid)) {
if (!UuidUtils.isAcceptableUuid(uuid)) {
return;
}

View File

@ -8,7 +8,7 @@ import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import java.util.UUID;
public class UUIDJsonDeserializer extends JsonDeserializer<UUID> {
public final class UuidJsonDeserializer extends JsonDeserializer<UUID> {
@Override
public UUID deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {

View File

@ -8,7 +8,7 @@ import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.util.UUID;
public final class UUIDJsonSerializer extends JsonSerializer<UUID> {
public final class UuidJsonSerializer extends JsonSerializer<UUID> {
@Override
public void serialize(UUID uuid, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {

View File

@ -8,7 +8,7 @@ import org.bson.codecs.EncoderContext;
import java.util.UUID;
public final class UUIDCodec implements Codec<UUID> {
public final class UuidCodec implements Codec<UUID> {
@Override
public UUID decode(BsonReader bsonReader, DecoderContext decoderContext) {

View File

@ -6,11 +6,11 @@ import org.bson.codecs.configuration.CodecRegistry;
import java.util.UUID;
public final class UUIDCodecProvider implements CodecProvider {
public final class UuidCodecProvider implements CodecProvider {
public <T> Codec<T> get(Class<T> clazz, CodecRegistry codecRegistry) {
if (clazz == UUID.class) {
return (Codec<T>) new UUIDCodec();
return (Codec<T>) new UuidCodec();
} else {
return null;
}

View File

@ -4,7 +4,7 @@ import com.bugsnag.Logger;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class BugsnagSLF4JLogger extends Logger {
public class BugsnagSlf4jLogger extends Logger {
public void debug(String message) {
log.debug(message);

View File

@ -12,11 +12,11 @@ import net.frozenorb.apiv3.model.User;
import java.util.concurrent.TimeUnit;
@UtilityClass
public class TOTPUtils {
public class TotpUtils {
private static GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(new GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder().setWindowSize(10).build());
public static GoogleAuthenticatorKey generateTOTPSecret() {
public static GoogleAuthenticatorKey generateTotpSecret() {
return googleAuthenticator.createCredentials();
}
@ -24,7 +24,7 @@ public class TOTPUtils {
return googleAuthenticator.authorize(user.getTotpSecret(), code);
}
public static String getQRCodeURL(User user, GoogleAuthenticatorKey secret) {
public static String getQrCodeUrl(User user, GoogleAuthenticatorKey secret) {
return GoogleAuthenticatorQRGenerator.getOtpAuthURL(
"MineHQ Network",
user.getLastUsername(),

View File

@ -5,9 +5,9 @@ import lombok.experimental.UtilityClass;
import java.util.UUID;
@UtilityClass
public class UUIDUtils {
public class UuidUtils {
public static boolean isAcceptableUUID(UUID uuid) {
public static boolean isAcceptableUuid(UUID uuid) {
return uuid.version() == 4;
}