Skip to content

Commit

Permalink
Rename hidden implementations for easier managing
Browse files Browse the repository at this point in the history
  • Loading branch information
imDaniX committed Apr 28, 2023
1 parent badff45 commit cd60a7b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static net.kyori.adventure.text.Component.empty;
import static net.kyori.adventure.text.Component.text;

final class DeserializerImpl {
final class IMDeserializerImpl {
private static final char END = 0;

private final String textStr;
Expand All @@ -25,7 +25,7 @@ final class DeserializerImpl {
private final TreeSet<Replacer.FoundSpot> replaceSpots;
private int globalIndex;

private DeserializerImpl(@NotNull String textStr, @NotNull InkyMessage.Resolver resolver) {
private IMDeserializerImpl(@NotNull String textStr, @NotNull InkyMessage.Resolver resolver) {
this.textStr = textStr;
this.hasSlashes = textStr.indexOf('\\') != -1;
this.resolver = resolver;
Expand All @@ -34,7 +34,7 @@ private DeserializerImpl(@NotNull String textStr, @NotNull InkyMessage.Resolver

public static @NotNull Component parse(@NotNull String textStr, @NotNull BuildContext context) {
if (textStr.length() == 0) return empty();
return new DeserializerImpl(textStr, context.resolver())
return new IMDeserializerImpl(textStr, context.resolver())
.parseInner(0, END, context)
.compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static ink.glowing.text.replace.StandardReplacers.urlReplacer;
import static ink.glowing.text.style.symbolic.SymbolicStyle.*;

final class ResolverImpl implements InkyMessage.Resolver {
final class IMResolverImpl implements InkyMessage.Resolver {
static final InkyMessage.Resolver STANDARD_RESOLVER = InkyMessage.Resolver.resolver()
.addTags(ColorTag.colorTag(),
HoverTag.hoverTag(),
Expand All @@ -46,7 +46,7 @@ final class ResolverImpl implements InkyMessage.Resolver {
private final Map<Character, SymbolicStyle> symbolics;
private final SymbolicStyle symbolicReset;

ResolverImpl(
IMResolverImpl(
@NotNull Iterable<StyleTag<?>> tags,
@NotNull Collection<Replacer> replacers,
@NotNull Iterable<SymbolicStyle> symbolics,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import static ink.glowing.text.InkyMessage.escape;

final class SerializerImpl {
private SerializerImpl() {}
final class IMSerializerImpl {
private IMSerializerImpl() {}

public static @NotNull String serialize(@NotNull Component text, @NotNull InkyMessage.Resolver resolver) {
StringBuilder builder = new StringBuilder();
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ink/glowing/text/InkyMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private InkyMessage() {}
* @return converted text component
*/
public @NotNull Component deserialize(@NotNull String inputText, @NotNull BuildContext context) {
return DeserializerImpl.parse(inputText, context);
return IMDeserializerImpl.parse(inputText, context);
}

@Override
Expand All @@ -71,7 +71,7 @@ private InkyMessage() {}
}

public @NotNull String serialize(@NotNull Component text, @NotNull Resolver resolver) {
return SerializerImpl.serialize(text, resolver);
return IMSerializerImpl.serialize(text, resolver);
}

public static @NotNull String escape(@NotNull String text) {
Expand Down Expand Up @@ -118,7 +118,7 @@ public interface Resolver {
* @return a standard resolver
*/
static @NotNull InkyMessage.Resolver standardResolver() {
return ResolverImpl.STANDARD_RESOLVER;
return IMResolverImpl.STANDARD_RESOLVER;
}

/**
Expand Down Expand Up @@ -253,7 +253,7 @@ static class ResolverBuilder implements AbstractBuilder<Resolver> {
@Contract("-> new")
public @NotNull InkyMessage.Resolver build() {
Objects.requireNonNull(symbolicReset, "InkyMessageResolver requires symbolic reset to be provided");
return new ResolverImpl(tags, replacers, symbolics, symbolicReset);
return new IMResolverImpl(tags, replacers, symbolics, symbolicReset);
}
}
}

0 comments on commit cd60a7b

Please sign in to comment.