From d3bf6129a8e5c3ed9b8e8aff360f33a7bb5a98f6 Mon Sep 17 00:00:00 2001 From: Teodor G Date: Tue, 13 Apr 2021 11:02:57 +0300 Subject: [PATCH] rename inside `memo` module --- .../com/zeoflow/memo/DefaultMemoFacade.java | 18 +++++------ .../memo/{Converter.java => IConverter.java} | 2 +- ...gInterceptor.java => ILogInterceptor.java} | 2 +- .../{MemoFacade.java => IMemoFacade.java} | 4 +-- .../memo/{Parser.java => IParser.java} | 6 ++-- .../{Serializer.java => ISerializer.java} | 2 +- .../memo/{Storage.java => IStorage.java} | 2 +- memo/src/main/java/com/zeoflow/memo/Memo.java | 2 +- .../java/com/zeoflow/memo/MemoBuilder.java | 30 +++++++++---------- .../java/com/zeoflow/memo/MemoConverter.java | 8 ++--- .../java/com/zeoflow/memo/MemoSerializer.java | 6 ++-- .../memo/SharedPreferencesStorage.java | 2 +- .../java/com/zeoflow/memo/ZsonParser.java | 2 +- 13 files changed, 43 insertions(+), 43 deletions(-) rename memo/src/main/java/com/zeoflow/memo/{Converter.java => IConverter.java} (95%) rename memo/src/main/java/com/zeoflow/memo/{LogInterceptor.java => ILogInterceptor.java} (88%) rename memo/src/main/java/com/zeoflow/memo/{MemoFacade.java => IMemoFacade.java} (96%) rename memo/src/main/java/com/zeoflow/memo/{Parser.java => IParser.java} (82%) rename memo/src/main/java/com/zeoflow/memo/{Serializer.java => ISerializer.java} (95%) rename memo/src/main/java/com/zeoflow/memo/{Storage.java => IStorage.java} (98%) diff --git a/memo/src/main/java/com/zeoflow/memo/DefaultMemoFacade.java b/memo/src/main/java/com/zeoflow/memo/DefaultMemoFacade.java index c9ecb18..8840662 100644 --- a/memo/src/main/java/com/zeoflow/memo/DefaultMemoFacade.java +++ b/memo/src/main/java/com/zeoflow/memo/DefaultMemoFacade.java @@ -1,13 +1,13 @@ package com.zeoflow.memo; -public class DefaultMemoFacade implements MemoFacade +public class DefaultMemoFacade implements IMemoFacade { - private final Storage storage; - private final Converter converter; + private final IStorage storage; + private final IConverter converter; private final Encryption encryption; - private final Serializer serializer; - private final LogInterceptor logInterceptor; + private final ISerializer serializer; + private final ILogInterceptor logInterceptor; public DefaultMemoFacade(MemoBuilder builder) { @@ -39,7 +39,7 @@ public boolean put(String key, T value) log("Memo.put -> Converted to " + plainText); if (plainText == null) { - log("Memo.put -> Converter failed"); + log("Memo.put -> IConverter failed"); return false; } @@ -132,7 +132,7 @@ public T get(String key) log("Memo.get -> Converted to : " + result); } catch (Exception e) { - log("Memo.get -> Converter failed"); + log("Memo.get -> IConverter failed"); } return result; @@ -155,7 +155,7 @@ public String encrypt(T value) log("Memo.put -> Converted to " + plainText); if (plainText == null) { - log("Memo.put -> Converter failed"); + log("Memo.put -> IConverter failed"); return ""; } @@ -223,7 +223,7 @@ public T decrypt(String value) log("Memo.get -> Converted to : " + result); } catch (Exception e) { - log("Memo.get -> Converter failed"); + log("Memo.get -> IConverter failed"); } return result; diff --git a/memo/src/main/java/com/zeoflow/memo/Converter.java b/memo/src/main/java/com/zeoflow/memo/IConverter.java similarity index 95% rename from memo/src/main/java/com/zeoflow/memo/Converter.java rename to memo/src/main/java/com/zeoflow/memo/IConverter.java index 664735a..3190825 100644 --- a/memo/src/main/java/com/zeoflow/memo/Converter.java +++ b/memo/src/main/java/com/zeoflow/memo/IConverter.java @@ -6,7 +6,7 @@ * * @see MemoConverter */ -public interface Converter +public interface IConverter { /** diff --git a/memo/src/main/java/com/zeoflow/memo/LogInterceptor.java b/memo/src/main/java/com/zeoflow/memo/ILogInterceptor.java similarity index 88% rename from memo/src/main/java/com/zeoflow/memo/LogInterceptor.java rename to memo/src/main/java/com/zeoflow/memo/ILogInterceptor.java index 3fa4fbb..755b919 100644 --- a/memo/src/main/java/com/zeoflow/memo/LogInterceptor.java +++ b/memo/src/main/java/com/zeoflow/memo/ILogInterceptor.java @@ -3,7 +3,7 @@ /** * Interceptor for all logs happens in the library */ -public interface LogInterceptor +public interface ILogInterceptor { /** diff --git a/memo/src/main/java/com/zeoflow/memo/MemoFacade.java b/memo/src/main/java/com/zeoflow/memo/IMemoFacade.java similarity index 96% rename from memo/src/main/java/com/zeoflow/memo/MemoFacade.java rename to memo/src/main/java/com/zeoflow/memo/IMemoFacade.java index 551a445..6c19af0 100644 --- a/memo/src/main/java/com/zeoflow/memo/MemoFacade.java +++ b/memo/src/main/java/com/zeoflow/memo/IMemoFacade.java @@ -1,6 +1,6 @@ package com.zeoflow.memo; -public interface MemoFacade +public interface IMemoFacade { boolean put(String key, T value); @@ -25,7 +25,7 @@ public interface MemoFacade void destroy(); - class EmptyMemoFacade implements MemoFacade + class EmptyMemoFacade implements IMemoFacade { @Override diff --git a/memo/src/main/java/com/zeoflow/memo/Parser.java b/memo/src/main/java/com/zeoflow/memo/IParser.java similarity index 82% rename from memo/src/main/java/com/zeoflow/memo/Parser.java rename to memo/src/main/java/com/zeoflow/memo/IParser.java index a7ecebd..cc7d152 100644 --- a/memo/src/main/java/com/zeoflow/memo/Parser.java +++ b/memo/src/main/java/com/zeoflow/memo/IParser.java @@ -4,14 +4,14 @@ /** * Intermediate layer that handles serialization/deserialization for the end result. - * This is not the same as {@link Serializer}. This interface is only used to convert the intermediate value - * into String or vice-versa to be used for {@link Storage} + * This is not the same as {@link ISerializer}. This interface is only used to convert the intermediate value + * into String or vice-versa to be used for {@link IStorage} * *

Use custom implementation if built-in implementation is not enough.

* * @see ZsonParser */ -public interface Parser +public interface IParser { /** diff --git a/memo/src/main/java/com/zeoflow/memo/Serializer.java b/memo/src/main/java/com/zeoflow/memo/ISerializer.java similarity index 95% rename from memo/src/main/java/com/zeoflow/memo/Serializer.java rename to memo/src/main/java/com/zeoflow/memo/ISerializer.java index effe75e..8fdfb7e 100644 --- a/memo/src/main/java/com/zeoflow/memo/Serializer.java +++ b/memo/src/main/java/com/zeoflow/memo/ISerializer.java @@ -7,7 +7,7 @@ * * @see MemoSerializer */ -public interface Serializer +public interface ISerializer { /** diff --git a/memo/src/main/java/com/zeoflow/memo/Storage.java b/memo/src/main/java/com/zeoflow/memo/IStorage.java similarity index 98% rename from memo/src/main/java/com/zeoflow/memo/Storage.java rename to memo/src/main/java/com/zeoflow/memo/IStorage.java index 7f6d81a..e25bfc6 100644 --- a/memo/src/main/java/com/zeoflow/memo/Storage.java +++ b/memo/src/main/java/com/zeoflow/memo/IStorage.java @@ -7,7 +7,7 @@ * * @see SharedPreferencesStorage */ -public interface Storage +public interface IStorage { /** diff --git a/memo/src/main/java/com/zeoflow/memo/Memo.java b/memo/src/main/java/com/zeoflow/memo/Memo.java index df88e48..ffc93b0 100644 --- a/memo/src/main/java/com/zeoflow/memo/Memo.java +++ b/memo/src/main/java/com/zeoflow/memo/Memo.java @@ -10,7 +10,7 @@ public final class Memo { - static MemoFacade memoFacade = new MemoFacade.EmptyMemoFacade(); + static IMemoFacade memoFacade = new IMemoFacade.EmptyMemoFacade(); private Memo() { diff --git a/memo/src/main/java/com/zeoflow/memo/MemoBuilder.java b/memo/src/main/java/com/zeoflow/memo/MemoBuilder.java index d4fa205..eaf7876 100644 --- a/memo/src/main/java/com/zeoflow/memo/MemoBuilder.java +++ b/memo/src/main/java/com/zeoflow/memo/MemoBuilder.java @@ -17,12 +17,12 @@ public class MemoBuilder private static final String STORAGE_TAG_DO_NOT_CHANGE = "MemoStorage"; private final Context context; - private Storage cryptoStorage; - private Converter converter; - private Parser parser; + private IStorage cryptoStorage; + private IConverter converter; + private IParser parser; private Encryption encryption; - private Serializer serializer; - private LogInterceptor logInterceptor; + private ISerializer serializer; + private ILogInterceptor logInterceptor; public MemoBuilder() { @@ -34,7 +34,7 @@ public MemoBuilder(Context context) this.context = context.getApplicationContext(); } - LogInterceptor getLogInterceptor() + ILogInterceptor getLogInterceptor() { if (logInterceptor == null) { @@ -45,12 +45,12 @@ LogInterceptor getLogInterceptor() } return logInterceptor; } - public MemoBuilder setLogInterceptor(LogInterceptor logInterceptor) + public MemoBuilder setLogInterceptor(ILogInterceptor logInterceptor) { this.logInterceptor = logInterceptor; return this; } - Storage getStorage() + IStorage getStorage() { if (cryptoStorage == null) { @@ -58,12 +58,12 @@ Storage getStorage() } return cryptoStorage; } - public MemoBuilder setStorage(Storage storage) + public MemoBuilder setStorage(IStorage storage) { this.cryptoStorage = storage; return this; } - Converter getConverter() + IConverter getConverter() { if (converter == null) { @@ -71,12 +71,12 @@ Converter getConverter() } return converter; } - public MemoBuilder setConverter(Converter converter) + public MemoBuilder setConverter(IConverter converter) { this.converter = converter; return this; } - Parser getParser() + IParser getParser() { if (parser == null) { @@ -84,7 +84,7 @@ Parser getParser() } return parser; } - public MemoBuilder setParser(Parser parser) + public MemoBuilder setParser(IParser parser) { this.parser = parser; return this; @@ -106,7 +106,7 @@ public MemoBuilder setEncryption(Encryption encryption) this.encryption = encryption; return this; } - Serializer getSerializer() + ISerializer getSerializer() { if (serializer == null) { @@ -114,7 +114,7 @@ Serializer getSerializer() } return serializer; } - public MemoBuilder setSerializer(Serializer serializer) + public MemoBuilder setSerializer(ISerializer serializer) { this.serializer = serializer; return this; diff --git a/memo/src/main/java/com/zeoflow/memo/MemoConverter.java b/memo/src/main/java/com/zeoflow/memo/MemoConverter.java index a2edbb2..9354969 100644 --- a/memo/src/main/java/com/zeoflow/memo/MemoConverter.java +++ b/memo/src/main/java/com/zeoflow/memo/MemoConverter.java @@ -15,16 +15,16 @@ * Serializable types will be encoded/decoded object stream * Not serializable objects will be encoded/decoded by parser */ -final class MemoConverter implements Converter +final class MemoConverter implements IConverter { - private final Parser parser; + private final IParser parser; - public MemoConverter(Parser parser) + public MemoConverter(IParser parser) { if (parser == null) { - throw new NullPointerException("Parser should not be null"); + throw new NullPointerException("IParser should not be null"); } this.parser = parser; } diff --git a/memo/src/main/java/com/zeoflow/memo/MemoSerializer.java b/memo/src/main/java/com/zeoflow/memo/MemoSerializer.java index 3417293..133bbbf 100644 --- a/memo/src/main/java/com/zeoflow/memo/MemoSerializer.java +++ b/memo/src/main/java/com/zeoflow/memo/MemoSerializer.java @@ -5,16 +5,16 @@ import java.util.Map; import java.util.Set; -class MemoSerializer implements Serializer +class MemoSerializer implements ISerializer { private static final char DELIMITER = '@'; private static final String INFO_DELIMITER = "#"; private static final char NEW_VERSION = 'V'; - private final LogInterceptor logInterceptor; + private final ILogInterceptor logInterceptor; - MemoSerializer(LogInterceptor logInterceptor) + MemoSerializer(ILogInterceptor logInterceptor) { this.logInterceptor = logInterceptor; } diff --git a/memo/src/main/java/com/zeoflow/memo/SharedPreferencesStorage.java b/memo/src/main/java/com/zeoflow/memo/SharedPreferencesStorage.java index c7752d3..d11aba3 100644 --- a/memo/src/main/java/com/zeoflow/memo/SharedPreferencesStorage.java +++ b/memo/src/main/java/com/zeoflow/memo/SharedPreferencesStorage.java @@ -3,7 +3,7 @@ import android.content.Context; import android.content.SharedPreferences; -final class SharedPreferencesStorage implements Storage +final class SharedPreferencesStorage implements IStorage { private final SharedPreferences preferences; diff --git a/memo/src/main/java/com/zeoflow/memo/ZsonParser.java b/memo/src/main/java/com/zeoflow/memo/ZsonParser.java index f40d6a9..1b23bc2 100644 --- a/memo/src/main/java/com/zeoflow/memo/ZsonParser.java +++ b/memo/src/main/java/com/zeoflow/memo/ZsonParser.java @@ -7,7 +7,7 @@ import java.lang.reflect.Type; -public final class ZsonParser implements Parser +public final class ZsonParser implements IParser { private final Zson zson;